Given a string n representing an integer, return the closest palindromic integer represented as a string, excluding n itself.
The distance between two integers is defined as the absolute difference between their numeric values. If there are multiple palindromic integers with the same minimal absolute difference to n, return the numerically smaller one.
Constraints:
n.length
n consists of only digits.
n does not have leading zeros.
n represents an integer in the range
Given a string n representing an integer, return the closest palindromic integer represented as a string, excluding n itself.
The distance between two integers is defined as the absolute difference between their numeric values. If there are multiple palindromic integers with the same minimal absolute difference to n, return the numerically smaller one.
Constraints:
n.length
n consists of only digits.
n does not have leading zeros.
n represents an integer in the range