





'''simple docstring'''






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





def       lowercase_      (		lowercase__						)   ->str:

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

      _snake_case:   Union[str, Any]  					=		[]
      backtrack(0						)
      return output


if __name__ == "__main__":
  import doctest

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












'''simple docstring'''






from __future__ import annotations

import sys
from collections import deque
from typing import Generic, TypeVar

A   : str             =			TypeVar('T')







class 			lowerCamelCase					(						Generic[T]  ):
					_SCREAMING_SNAKE_CASE							   =    42  # Cache store of keys
					_SCREAMING_SNAKE_CASE							   =    42  # References of the keys in cache
					_SCREAMING_SNAKE_CASE							   =    10  # Maximum capacity of cache


					def __init__(					self	:  List[Any]       ,     __snake_case	:  int       ):





											'''simple docstring'''





											_snake_case:   Dict  					=		deque()
											_snake_case:   Union[str, Any]  					=		set()
											if not n:
																	_snake_case:   Optional[int]  					=		sys.maxsize
											elif n < 0:
																	raise ValueError('n should be an integer greater than 0.'       )
											else:
																	_snake_case:   Tuple  					=		n


					def    SCREAMING_SNAKE_CASE_		(					self	:  Any       ,     __snake_case	:  T       ):





											'''simple docstring'''





											if x not in self.key_reference:
																	if len(self.dq_store       ) == LRUCache._MAX_CAPACITY:
																							_snake_case:   int  					=		self.dq_store.pop()
																							self.key_reference.remove(__snake_case       )
											else:
																	self.dq_store.remove(__snake_case       )

											self.dq_store.appendleft(__snake_case       )
											self.key_reference.add(__snake_case       )


					def    SCREAMING_SNAKE_CASE_		(					self	:  int       ):





											'''simple docstring'''





											for k in self.dq_store:
																	print(__snake_case       )




					def __repr__(					self	:  List[Any]       ):





											'''simple docstring'''





											return f'''LRUCache({self._MAX_CAPACITY}) => {list(self.dq_store       )}'''


if __name__ == "__main__":
		import doctest

		doctest.testmod()

		A   : LRUCache[str | int]             =			LRUCache(4)
		lru_cache.refer('A')
		lru_cache.refer(2)
		lru_cache.refer(3)
		lru_cache.refer('A')
		lru_cache.refer(4)
		lru_cache.refer(5)
		lru_cache.display()

		print(lru_cache)
		assert str(lru_cache) == "LRUCache(4) => [5, 4, 'A', 3]"





