Water Jug Problem In Python Algorithm