



'''simple docstring'''





from __future__ import annotations



def     UpperCAmelCase     (    a_		)   ->       bool:



   """simple docstring"""






   A_  :		int
   A_  :		list[str]						=					list(a_		)
   A_						,  A_  :		Any						=					_vector[:-1], int(_vector[-1]		)
   A_  :		list[int]						=					[int(a_		) for digit in __vector]

   vector.reverse()
   for i, digit in enumerate(a_		):
      if i & 1 == 0:
         A_  :		int						=					digit * 2
         if doubled > 9:
            doubled -= 9
         check_digit += doubled
      else:
         check_digit += digit

   return check_digit % 1_0 == 0


if __name__ == "__main__":
  import doctest

  doctest.testmod()
  assert is_luhn('79927398713')
  assert not is_luhn('79927398714')





'''simple docstring'''





def     UpperCAmelCase     (    a_ = 9_9_8_0_0_1		)   ->       int:



   """simple docstring"""






   for number in range(n - 1      ,		9_9_9_9      ,		-1		):
      A_  :		Optional[Any]						=					str(a_		)

      # checks whether 'str_number' is a palindrome.
      if str_number == str_number[::-1]:
         A_  :		int						=					9_9_9

         # if 'number' is a product of two 3-digit numbers
         # then number is the answer otherwise fetch next number.
         while divisor != 9_9:
            if (number % divisor == 0) and (len(str(number // divisor		)		) == 3.0):
               return number
            divisor -= 1
   raise ValueError("""That number is larger than our acceptable range."""		)


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