Kalepa interview question

Coding challenge to solve a problem