Why my answer is coming 1?

I m not able to find out that one silly mistake I’ve done

sort(stalls, stalls+n);
just this sorting statement was missing…

Ohhhh actually i was trying to match my code with prateek bhaiya’s code and prateek bhaiya’s code is also missing that sorting statement but prateek bhaiya manually sorted the array

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.