β back to unit
Easy
# queues easy
VIP Line
Regular fans join the back of the line. VIP pass holders walk straight to the FRONT (ahead of other VIPs too β rude, but legal). π
You get arrivals β reg:name or vip:name. Print the final line front to back, comma-separated.
Example:
Input: arrivals = ["reg:mia", "vip:leo", "reg:kai", "vip:ana"]
Output: ana,leo,mia,kai
Mia joins the back ([mia]), leo jumps to the front ([leo, mia]), kai joins the back ([leo, mia, kai]), and ana jumps to the very front β ahead of leo too β giving [ana, leo, mia, kai].
π‘ need a hint?
q-vip-line.pyπ given lines are locked β write your code in between
loading...