Razorpay interview question

Dsa problems easy to medium level