← back to unit
Easy
# queues easy
The Snack Pass
The popcorn bucket starts with the first kid and gets passed around the circle k times. Who's holding it now? 🍿
You get the names and the pass count k (maybe way more than one full loop!). Print the final holder.
Example:
Input: names = ["mia", "leo", "kai"], k = 4
Output: leo
Every pass moves the front person to the back. With 3 names, 3 passes is one full loop back to mia; the 4th pass moves it one more spot — to leo.
💡 need a hint?
q-snack-pass.py🔒 given lines are locked — write your code in between
loading...