Infoedge Interview Question

coding oa is of difficlt level