← All problemsSign in

Mom and Vegetable

Problem statement: Tommy's mom was used to send Tommy to market for buying N different types of vegetables from market, but Tommy was very notorious kid what he used to do was first buy all the vegetables and after that if he had some money left he used to spend it all in buying Candies. Due to this bad habit of Tommy Mom was very frustrated so she want to only give that sum of money to Tommy whi

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