← All problemsSign in

Chef wants to buy a laptop

Chef wants to buy a new laptop. The laptop costs $X$ rupees, and Chef currently has $Y$ rupees with him. Find how much money Chef needs to borrow from his friends in order to buy the laptop. If Chef already has enough money, print $0$. ## Function Description ### Function name: $borrowMoney$ has the following parameters: ### Parameters * $X$ : the price of the laptop * $Y$ : the money Chef

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