← Questions

Robot charging controller with exclusive stations

0
AmazonCodingLast asked Jan 2026

A fleet of robots shares a small number of charging stations. A robot whose battery drops below 50% should go to a free station, and a robot charging above 95% may leave and go back to work; a station holds one robot at a time. Write the controller that is called repeatedly: each time it checks the robots' battery levels and decides who goes to which station and who leaves. Make sure two robots never get the same station and that repeated polling does not send the same robot twice.

Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding