← All problemsSign in

Cut the Bamboo

Devansham Upadhyay, the King of Bamboo Forest, wants some bamboo for the winter season. He doesn't like the cutting of forest but also needs some Bamboo. He needs a collection of $K$ Bamboo and has asked you to cut all the Bamboo at maximum height $H$ from the ground to satisfy the requirement. You will be provided with an array of size $N$ containing the list of heights of Bamboo as $h1, h2, ...h

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