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 hints

Topics

Also asked at 6 companies


More Uber Questions

View all Uber questions