← All problemsSign in

BUCKETS2016

Sandeep has N magical buckets.Each magical bucket has a maximum capacity of 4 L.The special thing about these buckets is if you add 1 more litre to a bucket containing 4 L(A full bucket),the bucket explodes and all the water which it was containing (i.e 4 L) is lost, But then the bucket magically repairs itself (But now it is empty).Along with these N magical buckets he also has a giant bucket

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