BrickRed interview question

water jug problem