InterviewBit Academy is now Scaler!
InterviewBit Academy is now Scaler Academy!

Measure Milk by Cans

There is a drum full of milk.
People come for buying milk in the range of 1-40 litres.
You can have only 4 cans to draw milk out of drum. Tell me what should be the measurement of these four cans so that you can measure any amount of milk in the range of 1-40 litres.

Note that the cans cannot be used more than once.

Output the numbers in ascending order space separated.

Sign Up
to access hints and editorial solutions for Measure Milk by Cans
Asked In:


Click here to start solving coding interview questions