






from graphs.minimum_spanning_tree_kruskal import kruskal




def      lowercase__      (     ):


					'''simple docstring'''


					UpperCAmelCase_    :      str            =						9
					UpperCAmelCase_    :      Tuple            =						[
					    [0, 1, 4],
					    [0, 7, 8],
					    [1, 2, 8],
					    [7, 8, 7],
					    [7, 6, 1],
					    [2, 8, 2],
					    [8, 6, 6],
					    [2, 3, 7],
					    [2, 5, 4],
					    [6, 5, 2],
					    [3, 5, 14],
					    [3, 4, 9],
					    [5, 4, 10],
					    [1, 7, 11],
					]

					UpperCAmelCase_    :      List[str]            =						kruskal(__snake_case     ,       __snake_case  )

					UpperCAmelCase_    :      str            =						[
					    [7, 6, 1],
					    [2, 8, 2],
					    [6, 5, 2],
					    [0, 1, 4],
					    [2, 5, 4],
					    [2, 3, 7],
					    [0, 7, 8],
					    [3, 4, 9],
					]

					assert sorted(__snake_case  ) == sorted(__snake_case  )









def   __SCREAMING_SNAKE_CASE					(SCREAMING_SNAKE_CASE__       ):
						snake_case_   =	[]
						if len(SCREAMING_SNAKE_CASE__       ) == 1:
												return [nums.copy()]
						for _ in range(len(SCREAMING_SNAKE_CASE__       )       ):
												snake_case_   =	nums.pop(0       )
												snake_case_   =	permute(SCREAMING_SNAKE_CASE__       )
												for perm in permutations:
																		perm.append(SCREAMING_SNAKE_CASE__       )
												result.extend(SCREAMING_SNAKE_CASE__       )
												nums.append(SCREAMING_SNAKE_CASE__       )
						return result


def   __SCREAMING_SNAKE_CASE					(SCREAMING_SNAKE_CASE__       ):

						def backtrack(SCREAMING_SNAKE_CASE__       ):
												if start == len(SCREAMING_SNAKE_CASE__       ) - 1:
																		output.append(nums[:]       )
												else:
																		for i in range(SCREAMING_SNAKE_CASE__  ,		len(SCREAMING_SNAKE_CASE__       )       ):
																								snake_case_,    snake_case_   =	nums[i], nums[start]
																								backtrack(start + 1       )
																								snake_case_,    snake_case_   =	nums[i], nums[start]  # backtrack

						snake_case_   =	[]
						backtrack(0       )
						return output


if __name__ == "__main__":
					import doctest

					# use res to print the data in permute2 function
					lowerCAmelCase_       	=	permutea([1, 2, 3])
					print(res)
					doctest.testmod()