1842. Next Palindrome Using Same Digits
https://leetcode.com/problems/next-palindrome-using-same-digits
Description
You are given a numeric string num
, representing a very large palindrome.
Return the smallest palindrome larger than num
that can be created by rearranging its digits. If no such palindrome exists, return an empty string ""
.
A palindrome is a number that reads the same backward as forward.
Example 1:
Example 2:
Example 3:
Constraints:
1 <= num.length <= 105
num
is a palindrome.
ac
Last updated