Search range in Aggressive cows

why we have taken e = stalls[n-1] - stalls[0] rather than
e = stalls[n-1]

@rudrakshi99, since you have to find the maximum distance between two cows ,also [s,e] denotes the range in which your answer can lie, so the max answer you can get is by placing one cow at the start and another at the end stall , and the distance between the two is stalls[n-1]-stall[0] ,

Yes, I got it as we have placed already a cow at stall[0].
Thanks.