Search⌘ K
AI Features

Solution: K Empty Slots

Understand how to solve the K Empty Slots problem by transforming the bulb activation states into days and using a min heap to track intermediate bulbs. This lesson helps you identify the earliest valid day meeting the condition of exact off bulbs between two on bulbs, applying time and space efficient methods.

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 ...