India Health Link interview question

programing round asked to solve a program