MakeMyTrip interview question

2 coding questions medium DS Algo.