
"""simple docstring"""



def 					lowerCamelCase   (     _snake_case    ,_snake_case    ,_snake_case    ,_snake_case ):

    # 1. Validate that path exists between current and next vertices
    if graph[path[curr_ind - 1]][next_ver] == 0:
        return False

    # 2. Validate that next vertex is not already in path
    return not any(vertex == next_ver for vertex in path )
def 					lowerCamelCase   (     _snake_case    ,_snake_case    ,_snake_case ):

    # Base Case
    if curr_ind == len(_snake_case ):
        # return whether path exists between current and starting vertices
        return graph[path[curr_ind - 1]][path[0]] == 1

    # Recursive Step
    for next_ver in range(0    ,len(_snake_case ) ):
        if valid_connection(_snake_case    ,_snake_case    ,_snake_case    ,_snake_case ):
            # Insert current vertex  into path as next transition
            UpperCAmelCase__	:      str     							=					next_ver
            # Validate created path
            if util_hamilton_cycle(_snake_case    ,_snake_case    ,curr_ind + 1 ):
                return True
            # Backtrack
            UpperCAmelCase__	:      int     							=					-1
    return False

def 					lowerCamelCase   (     _snake_case    ,_snake_case = 0 ):
    UpperCAmelCase__	:      str     							=					[-1] * (len(_snake_case ) + 1)
    # initialize start and end of path with starting index
    UpperCAmelCase__	:      Optional[Any]     							=					start_index
    # evaluate and if we find answer return path either return empty array
    return path if util_hamilton_cycle(_snake_case    ,_snake_case    ,1 ) else []



"""simple docstring"""



def 					lowerCamelCase   (     _snake_case    ,_snake_case ):
    return int((input_a, input_a).count(0 ) == 0 )
def 					lowerCamelCase   (     ):
    assert and_gate(0    ,0 ) == 0
    assert and_gate(0    ,1 ) == 0
    assert and_gate(1    ,0 ) == 0
    assert and_gate(1    ,1 ) == 1


if __name__ == "__main__":
    test_and_gate()
    print(and_gate(1, 0))
    print(and_gate(0, 0))
    print(and_gate(0, 1))
    print(and_gate(1, 1))

