Can anyone explain the intuition of the problem Elevator Riding(CSES Problem)?

Problem link CSES - Elevator Rides

1 Like

Have a look here