โ back to unit
Medium
# breaking it down medium
The Escalator Race
Three friends race to the top floor: one takes the stairs, one stands on the escalator, one WALKS UP the escalator. ๐
The stairs are ls steps (climbed at a steps/sec); the escalator is le steps (it moves at e steps/sec โ the stander rides at e, the walker moves at a + e). Time = steps รท speed, rounded up. Exactly one friend is fastest. Print stairs, stander, or walker.
Example:
Input: ls = 30, a = 3, le = 60, e = 4
Output: walker
Stairs take 30 รท 3 = 10s. The stander rides at 4/s, taking 60 รท 4 = 15s. The walker moves at 3 + 4 = 7/s, taking โ60 รท 7โ = 9s โ the walker is fastest.
๐ก need a hint?
brk-escalator-race.py๐ given lines are locked โ write your code in between
loading...