PhonePe interview question

PS / DS round in js