X Interview Question

Coding Challenge through hackerrank