1997. Next Palindrome Using Same Digits

Hard
Two Pointers
String

Description

Hints

Hint 1
Is it possible to swap one character in the first half of the palindrome to make the next one?
Hint 2
Are there different cases for when the length is odd and even?

Statistics

Acceptance
54.0%
Submissions
12,644
Accepted
6,834