# queues easy

The Double-Door Bus

This fancy bus has doors at BOTH ends β€” the conductor's list says which door each kid uses. 🚌

You get commands β€” front:name or back:name. Board everyone with a deque (appendleft and append) and print the bus from front to back, comma-separated.

Example:

Input: commands = ["back:mia", "front:leo", "back:kai"] Output: leo,mia,kai

Mia boards at the back first ([mia]), leo boards at the front ([leo, mia]), then kai boards at the back ([leo, mia, kai]).

πŸ’‘ need a hint?

q-double-door-bus.pyπŸ”’ given lines are locked β€” write your code in between
loading...