





def _a				(	lowerCamelCase:   int					,				lowerCamelCase:   Optional[int]					,				lowerCamelCase:   Tuple					,				lowerCamelCase:   Tuple )	->						str:







      '''simple docstring'''






      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 _a				(	lowerCamelCase:   Optional[Any]					,				lowerCamelCase:   Dict					,				lowerCamelCase:   Any )	->						List[Any]:







      '''simple docstring'''






      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
                  __A          =				next_ver
                  # Validate created path
                  if util_hamilton_cycle(snake_case_					,				snake_case_					,				curr_ind + 1 ):
                        return True
                  # Backtrack
                  __A          =				-1
      return False







def _a				(	lowerCamelCase:   int					,				lowerCamelCase:   Optional[int] = 0 )	->						Dict:







      '''simple docstring'''






      __A          =				[-1] * (len(snake_case_ ) + 1)
      # initialize start and end of path with starting index
      __A          =				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 []











def 				lowerCAmelCase_	(     snake_case_     ):
      if number < 0:
            raise ValueError("""number must not be negative"""     )
      return number & (number - 1) == 0


if __name__ == "__main__":
  import doctest

  doctest.testmod()

