β back to unit
Easy
# queues easy
The Growing Line
Photograph the whole line at closing time. π·
You get commands (join:name / serve, serves valid). Print the final line from front to back, comma-separated, or empty.
Example:
Input: commands = ["join:mia", "join:leo", "serve", "join:kai"]
Output: leo,kai
Mia and leo join, serve removes mia (the front), then kai joins the back β leaving leo,kai.
π‘ need a hint?
q-growing-line.pyπ given lines are locked β write your code in between
loading...