← All problemsSign in

Samosa

Motu and Patlu have won a Jackpot of n bags of Samosas. Each bag is tagged with a number from 1 to n and the number of Samosas contained in each bag is equal to the tag number. (eg: Bag1 contains 1 Samosa and Bag2 contains 2 Samosas, etc...) Motu and Patlu have decided to divide the bags among themselves such that the total number of Samosas each of them receive is equal. Sum(M) - Sum(P) = 0

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