Find the Closest Palindrome at Uber
Hard31.8% acceptance
This problem has 87.5% frequency at Uber.
Problem Description
Given a string `n` representing an integer, return _the closest integer (not including itself), which is a palindrome_. If there is a tie, return _**the smaller one**_. The closest is defined as the absolute difference minimized between two integers.
Read full problem and hintsTopics
Also asked at 6 companies
More Uber Questions
Text JustificationHardWord SearchMediumWord Search IIHardInsert Delete GetRandom O(1)MediumEvaluate DivisionMedium
View all Uber questions