You have three cans of capacity 8, 5, 3 ltrs. 8 ltr can is filled with 8 ltrs of water, 5 and 3 ltr cans are empty. How do u measure 4 ltrs without throwing away water and without adding any.
8 5 3 Cans
==================
8 0 0 Initial State
3 5 0
3 2 3
6 2 0
6 0 2
1 5 2
1 4 3
8 5 3 Cans
8 0 0 Initial State
5 0 3
5 3 0
2 3 3
2 5 1
7 0 1
7 1 0
4 1 3
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks