Pls help me to debug the code;

hello @Senjuti256
a) u r not sorting ur array.
b) end=stalls[n-1]-stalls[0]