Shifu and Sweets
CodeChefOpen on judge ↗
Shifu goes to Chef sweets shop to by sweets for Oogway. Chef has $N$ sweets that are placed in increasing serial number of sweets going from $1$ to $N$. The coins required to purchase $i^{th}$ serial number sweet is $C_i$. Shifu has $K$ coins with him. He needs to purchase maximum number of sweets with continuous serial number. Can you tell the starting and ending of serial number of sweets seque
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.
Sign in to chat with the tutor and save your progress.
Sign in to start