


'''simple docstring'''






def  _snake_case       (					A	)						->   list[list[int]]:
							lowerCAmelCase__	       =     []
							if len(A	) == 1:
														return [nums.copy()]
							for _ in range(len(A	)	):
														lowerCAmelCase__	       =     nums.pop(0	)
														lowerCAmelCase__	       =     permute(A	)
														for perm in permutations:
																					perm.append(A	)
														result.extend(A	)
														nums.append(A	)
							return result


def  _snake_case       (					A	)						->   int:

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

							lowerCAmelCase__	       =     []
							backtrack(0	)
							return output


if __name__ == "__main__":
		import doctest

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



'''simple docstring'''






def  _snake_case       (					A = 10			,   A = 22	)						->   int:
							lowerCAmelCase__	       =     range(1			,   A	)
							lowerCAmelCase__	       =     range(1			,   A	)
							return sum(
							    1 for power in powers for base in bases if len(str(base**power	)	) == power	)


if __name__ == "__main__":
		print(f"""{solution(10, 22) = }""")