Participate in Codex, Test Your Skills & Win BIG

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.

  • Complete Solution
Asked In:


Click here to start solving coding interview questions