Lucid Software Interview Question

Hacker rank programming exercise (1 question).