About search space calculation

i dont understand how to choose start and end point.

explain with this or better example
what is distance between bars are
2,4,8,10,20

then what is out start and end point.

For this question, first you need to sort the given array, as :
2,4,8,10,20

So start = stall[0]= 2;
end = stall[n-1]-stall[0]=20-2=18
So search space will be 2 to 18…

For more understanding , you can refer to this video… Prateek bhaiya has already explained the problem …