main.py
def validJug(a, b, goal_amount):
    """ Checks if you can reach get to the goal_amount with the maximum jug
    amount. Also rules out some of the eligible states that won't work.
    Doesn't rule them all out."""
    valid = False
    if type(goal_amount) is int:
        if goal_amount > a and goal_amount > b:
            return valid
        if goal_amount % math.gcd(a, b) == 0:
            valid = True
    elif type(goal_amount) is tuple:
        a1 = goal_amount[0]
        a2 = goal_amount[1]
        if (a1 % math.gcd(a, b) == 0) and (a2 % math.gcd(a, b) == 0) and a1 \
                <= a and a2 <= b:
            valid = True
    return valid
 Checks if you can reach get to the goal_amount with the maximum jug
    amount. Also rules out some of the eligible states that won't work.
    Doesn't rule them all out.
Checks if you can reach get to the goal_amount with the maximum jug
amount. Also rules out some of the eligible states that won't work.
Doesn't rule them all out.
Checks if you can reach get to the goal_amount with the maximum jug amount . Also rules out some of the eligible states that won ' t work . Doesn ' t rule them all out .
def validJug(a, b, goal_amount):
    valid = False
    if type(goal_amount) is int:
        if goal_amount > a and goal_amount > b:
            return valid
        if goal_amount % math.gcd(a, b) == 0:
            valid = True
    elif type(goal_amount) is tuple:
        a1 = goal_amount[0]
        a2 = goal_amount[1]
        if (a1 % math.gcd(a, b) == 0) and (a2 % math.gcd(a, b) == 0) and a1 \
                <= a and a2 <= b:
            valid = True
    return valid
def validJug ( a , b , goal_amount ) : valid = False if type ( goal_amount ) is int : if goal_amount > a and goal_amount > b : return valid if goal_amount % math . gcd ( a , b ) == 0 : valid = True elif type ( goal_amount ) is tuple : a1 = goal_amount [ 0 ] a2 = goal_amount [ 1 ] if ( a1 % math . gcd ( a , b ) == 0 ) and ( a2 % math . gcd ( a , b ) == 0 ) and a1 <= a and a2 <= b : valid = True return valid
Checks if you can reach get to the goal_amount with the maximum jug
amount.
Checks if you can reach get to the goal_amount with the maximum jug amount .
""" Checks if you can reach get to the goal_amount with the maximum jug
    amount. Also rules out some of the eligible states that won't work.
    Doesn't rule them all out."""
a
b
goal_amount