https://www.codechef.com/viewsolution/32419835
Whats wrong?
The question link
actually you are counting only at the boarding and leaving stations however you have to count at every station possible from -infinity to +infinity.
You don’t just have to count the boarding and departure station of each passenger but also the stations for which he is in the journey. You can find my solution here:
https://www.codechef.com/viewsolution/32400428