LogStarERP interview question

Water Jug Problem Code ?