← All problemsSign in

Buy Flowers

There is a huge garden in the city. The Garden contains n numbers of flowers. James has arrived in that city to buy exactly k flowers. He then went to the owner of this garden to discuss the prices of flowers. The owner of the garden provides James with an array ‘cost’ of n numbers which denotes the prices of the flower, the price of $i^{th}$ flower is cost[i]. Since today is the Birthday of Own

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