← back to unit
Easy
# queues easy
Now Serving
The NOW SERVING sign shows whoever stands at the front. 🔔
You get commands (join:name / serve, serves valid). After processing them all, print who the sign shows now — or no line if it's empty.
Example:
Input: commands = ["join:ana", "join:raj", "serve"]
Output: raj
Ana joins, raj joins, then serve removes ana from the front — raj is now at the front, so the sign shows raj.
💡 need a hint?
q-now-serving.py🔒 given lines are locked — write your code in between
loading...