← All problemsSign in

Cleaning the Space

A spacecraft is all set to travel through a long inter-galactic tunnel. The tunnel consists of N stationary space debris. In order to successfully complete the mission the spacecraft needs to destroy all the space debris. The control unit of the spacecraft has M buttons which can be used to destroy the space debris. Pressing a particular button may result in the destruction of some (possibly multi

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start