← All problemsSign in

Happy Birthday

Today is the birthday of Mukesh. He wants to buy sweets for his friends so he went to the Chef sweet shop. He has $X$ amount of cash with him. The pricing of sweets is as follows. If he selects $N$ sweets and places them in a single line then the price of the $i^{th}$ sweet from left is $i^2$. He wants to maximize his purchase of sweets to share with his friends. Can you help him? Chef has a tot

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