Problem 1298 · Hard

Maximum Candies You Can Get from Boxes

Open boxes you can reach, collect their candies and keys, and queue the boxes they contain. Boxes that are locked without a key wait until a key arrives.

Open the interactive visualisation