← back to unit
Easy
# breaking it down easy
The Elevator's Day
The elevator's odometer counts every floor it passes, up or down. 🛗
It starts at floor 0 and visits each floor in the requests list, in order. Print the total floors traveled.
Example:
Input: requests = [3, 1, 5]
Output: 9
From 0 to 3 is 3 floors, 3 to 1 is 2 floors, 1 to 5 is 4 floors — the odometer totals 3 + 2 + 4 = 9.
💡 need a hint?
brk-elevator-day.py🔒 given lines are locked — write your code in between
loading...