Clarification regarding algo

while applying binary search for this problem how are we taking last as INT_MAX and not the end of the input array

problem: https://hack.codingblocks.com/app/contests/2022/1056/problem

at 2:00:11 time in the video

Hello @raghav007 i dont think talking last as INT_MAX will be fine because we are unnecessarily checking for the few numbers which will definitely not be the answers as after sorting the array the maximum distance which we can give will be the difference of the last position and the first position.