





from __future__ import annotations

a__			:    List[str]			      =		"""Alexander Joslin"""

def     UpperCAmelCase_						(						_UpperCAmelCase       :Tuple							)  ->							int:
     '''simple docstring'''


     if number <= 0:
          A_					      =					f'n must be greater than 0. Got n = {number}'
          raise ValueError(__lowerCamelCase							)

     A_					      =					[number + 1] * (number + 1)

     # starting position
     A_					      =					0
     for i in range(1     ,	__lowerCamelCase							):
          A_					      =					min(table[i + 1]     ,	table[i] + 1							)
          # check if out of bounds
          if i * 2 <= number:
               A_					      =					min(table[i * 2]     ,	table[i] + 1							)
          # check if out of bounds
          if i * 3 <= number:
               A_					      =					min(table[i * 3]     ,	table[i] + 1							)
     return table[number]


if __name__ == "__main__":
    import doctest

    doctest.testmod()










import itertools
from pathlib import Path

def     UpperCAmelCase_						(						_UpperCAmelCase       :list[str]							)  ->							int:
     '''simple docstring'''


     A_					      =					[tuple(_UpperCAmelCase							) for login in logins]

     A_					      =					{char for login in split_logins for char in login}

     for permutation in itertools.permutations(_UpperCAmelCase							):
          A_					      =					True
          for login in logins:
               if not (
                   permutation.index(login[0]							)
                   < permutation.index(login[1]							)
                   < permutation.index(login[2]							)
               ):
                    A_					      =					False
                    break

          if satisfied:
               return int(''''''.join(_UpperCAmelCase							)							)

     raise Exception('''Unable to find the secret passcode'''							)

def     UpperCAmelCase_						(						_UpperCAmelCase       :str = "keylog.txt"							)  ->							int:
     '''simple docstring'''


     A_					      =					Path(_UpperCAmelCase							).parent.joinpath(_UpperCAmelCase							).read_text().splitlines()

     return find_secret_passcode(_UpperCAmelCase							)


if __name__ == "__main__":
      print(f'''{solution() = }''')



