CureMD Interview Question

the asked to solve a coding