Maximum candies from boxes with keys

0
Remix

Some boxes are open and some are locked. Each box holds candies, keys to other boxes, and more boxes. You start with a few boxes. You may open a box once you have it and it is open or you hold its key. Return the most candies you can collect. Process boxes with a queue, and remember boxes you hold but cannot open yet, since a key may turn up later.

AirbnbTechnical phone screenLast asked May 2026
No answer yet. Write the first one; the best answer gets endorsed.