Weird Elevator

I am solving this problem and I didn’t understand its testcases. Can someone help to explain its testcases and tell approach to solve this problem?
Thanks