← back to unit
Medium
# queues medium
The Spotlight Window
The stage spotlight lights exactly k performers at a time; each slide shifts it one performer to the right. 🎭
You get the performers in stage order, the width k, and the number of slides. The spotlight starts on the first k performers. Print who's lit at the end, comma-separated.
Example:
Input: performers = ["ana", "bo", "cy", "dee", "eli", "fay"], k = 3, slides = 2
Output: cy,dee,eli
The spotlight starts on ana, bo, cy. Each slide drops the leftmost and admits the next performer — after 2 slides it's lit on cy, dee, eli.
💡 need a hint?
q-spotlight-window.py🔒 given lines are locked — write your code in between
loading...