






"""simple docstring"""





from __future__ import annotations

UpperCamelCase			=      """Alexander Joslin"""






def     A(  snake_case_		):
       """simple docstring"""





       if number <= 0:
              lowercase__:    Any        =      F"""n must be greater than 0. Got n = {number}"""
              raise ValueError(snake_case_		)

       lowercase__:    Union[str, Any]        =      [number + 1] * (number + 1)

       # starting position
       lowercase__:    Tuple        =      0
       for i in range(1						,       snake_case_		):
              lowercase__:    Tuple        =      min(table[i + 1]						,       table[i] + 1		)
              # check if out of bounds
              if i * 2 <= number:
                     lowercase__:    Optional[int]        =      min(table[i * 2]						,       table[i] + 1		)
              # check if out of bounds
              if i * 3 <= number:
                     lowercase__:    Optional[Any]        =      min(table[i * 3]						,       table[i] + 1		)
       return table[number]


if __name__ == "__main__":
  import doctest

  doctest.testmod()














"""simple docstring"""





from __future__ import annotations






def     A(  snake_case_						,       snake_case_		):
       """simple docstring"""





       lowercase__  ,     lowercase__:    Optional[int]        =      0, len(snake_case_		) - 1
       while start_ind <= end_ind:
              if array[start_ind] == search_item:
                     return start_ind
              elif array[end_ind] == search_item:
                     return end_ind
              else:
                     start_ind += 1
                     end_ind -= 1
    # returns -1 if search_item is not found in array
       return -1


if __name__ == "__main__":
  print(double_linear_search(list(range(1_00)), 40))






