Insi Interview Question

It was a Hackerrank coding challenge