Infoedge interview question

coding oa is of difficlt level