首页 > 代码库 > [LeetCode] Find the Closest Palindrome 寻找最近的回文串
[LeetCode] Find the Closest Palindrome 寻找最近的回文串
Given an integer n, find the closest integer (not including itself), which is a palindrome.
The ‘closest‘ is defined as absolute difference minimized between two integers.
Example 1:
Input: "123"Output: "121"
Note:
- The input n is a positive integer represented by string, whose length will not exceed 18.
- If there is a tie, return the smaller one as answer.
s
[LeetCode] Find the Closest Palindrome 寻找最近的回文串
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。