input: Write a function to find the closest palindrome number.
  assert findClosestPalindrome(123) == 121
  assert findClosestPalindrome(99) == 99
  assert findClosestPalindrome(10) == 9
  assert findClosestPalindrome(1) == 1
output: def findClosestPalindrome(n):
      def is_palindrome(x):
          return str(x) == str(x)[::-1]
      
      if is_palindrome(n):
          return n
      
      smaller, larger = n - 1, n + 1
      while True:
          if is_palindrome(smaller):
              return smaller
          if is_palindrome(larger):
              return larger
          smaller -= 1
          larger += 1