Zignuts Technolab interview question

An easy problem to solve using js?