← All problemsSign in

GARDEN

Chef has very beautiful garden.There are $N$ flower plants arranged in row.The height and beauty of $i$th flower from left is $h$i and $b$i.In order to make garden less crowdy chef decided to pull out some flower plants. But chef has one condition in mind that needs to be met while pulling flower plants. - The heights of the remaining flower plants must be monotonically increasing from left

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