



"""simple docstring"""






def     _lowercase       (						__snake_case			)		->     list[list[int]]:
			__lowerCAmelCase   :						str				= []
			if len(__snake_case			) == 1:
						return [nums.copy()]
			for _ in range(len(__snake_case			)			):
						__lowerCAmelCase   :						Union[str, Any]				= nums.pop(0			)
						__lowerCAmelCase   :						Optional[int]				= permute(__snake_case			)
						for perm in permutations:
									perm.append(__snake_case			)
						result.extend(__snake_case			)
						nums.append(__snake_case			)
			return result


def     _lowercase       (						__snake_case			)		->     int:

			def backtrack(__snake_case			):
						if start == len(__snake_case			) - 1:
									output.append(nums[:]			)
						else:
									for i in range(__snake_case      ,len(__snake_case			)			):
												__lowerCAmelCase   :						Any				= nums[i], nums[start]
												backtrack(start + 1			)
												__lowerCAmelCase   :						List[str]				= nums[i], nums[start]  # backtrack

			__lowerCAmelCase   :						Any				= []
			backtrack(0			)
			return output


if __name__ == "__main__":
				import doctest

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




"""simple docstring"""






def     _lowercase       (						__snake_case      ,__snake_case			)		->     list:
			__lowerCAmelCase   :						List[str]				= len(__snake_case			)
			__lowerCAmelCase   :						Dict				= []
			for i in range(len(__snake_case			) - pat_len + 1			):
						__lowerCAmelCase   :						List[Any]				= True
						for j in range(__snake_case			):
									if s[i + j] != pattern[j]:
												__lowerCAmelCase   :						Union[str, Any]				= False
												break
						if match_found:
									position.append(__snake_case			)
			return position


if __name__ == "__main__":
	assert naive_pattern_search('ABCDEFG', 'DE') == [3]
	print(naive_pattern_search('ABAAABCDBBABCDDEBCABC', 'ABC'))