Search⌘ K
AI Features

Solution: K Empty Slots

Explore the K Empty Slots solution by learning how to track bulb activation days using a min heap. Understand how to identify the earliest day with two bulbs on separated by exactly k off bulbs, using an efficient linear time algorithm and space optimization.

Statement

You are given nn bulbs arranged in a row, numbered from 11 to nn. Initially, all bulbs are turned off.

Each day, exactly one bulb is switched on. You are given an array, bulbs of length ...