← All problemsSign in

Destroy The Asteroids

Rick has set out on a space journey to destroy asteroids. He has identified $N$ different groups (numbered from $1$ to $N$) of Asteroids. The size of groups $G_1$, $G_2$, ...., $G_n$ are given. Using his superpowers, he can destroy exactly 1 asteroid from $K$ different groups in 1 minute. He doesn't want to waste his superpower so he will stop once there are less than $K$ groups available. Y

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