What is the need to allocate min(ans , mid) to ans?
Isn’t it obvious that the value of next mid will always be smaller than ans? so, just say ans=mid
What is the need to allocate min(ans , mid) to ans?
Isn’t it obvious that the value of next mid will always be smaller than ans? so, just say ans=mid