PhonePe interview question

Max Min using Binary Search