LLD - Design — Elevator System
Identify the error in this state transition logic for a system with states
idle, moving up, and moving down:
if state == 'idle' and event == 'move up':
state = 'moving up'
elif state == 'moving up' and event == 'move down':
state = 'moving down'
elif state == 'moving down' and event == 'stop':
state = 'idle'