Process a sequence of elevator requests and determine the elevator's movement or final state according to the given rules.
You are given a building elevator and a sequence of requests. The elevator starts at a known floor, and each request asks the elevator to move to a target floor. Process the requests in order and simulate the elevator’s movement exactly as specified.
The task is to determine the resulting elevator behavior after handling all requests, such as the floors visited, the total movement, or the final floor/state, depending on the request rules.
This is a direct simulation problem: read the requests in order, apply the movement rules one by one, and track the elevator state carefully.
The input format is intentionally generalized:
Return the final result required by the problem statement after all requests are processed. This may be the final floor, a movement count, or another aggregate value depending on the exact rules.
Example 1
Input
Start floor: 1 Requests: [3, 2, 5]
Output
Final floor: 5
Explanation
The elevator moves from 1 to 3, then 3 to 2, then 2 to 5. The final floor is 5.
Premium problem context
Premium adds guided hints, editorial links, similar variants, discussion resources, and concept maps so you can understand why a problem matters, not just solve it once.