Finoit Interview Question

Not able to clear the coding round