# Closest Palindrome
## Hard 
<div class="problem-statement">
                <p></p><p><span style="font-size:18px">Given a number num,&nbsp;our task is to find the closest Palindrome number whose absolute difference with given number is minimum. If 2 Palindome numbers have same absolute difference from the given number, then find&nbsp;the smaller one.</span><br>
&nbsp;</p>
<p><span style="font-size:18px"><strong>Example 1:</strong></span></p>
<pre><span style="font-size:18px"><strong>Input: </strong>num = 9
<strong>Output: </strong>9
<strong>Explanation: </strong>9 itself is a palindrome
number.</span>
</pre>
<p><span style="font-size:18px"><strong>Example 2:</strong></span></p>
<pre><span style="font-size:18px"><strong>Input: </strong>num = 489
<strong>Output: </strong>494
<strong>Expnataion: </strong>closest palindrome numbers from
489 are 484 and 494. Absolute difference between
489 and 494 is equal to the absolute difference
between 484 and 489 but 484 is smaller than 494.</span>
</pre>
<p>&nbsp;</p>
<p><span style="font-size:18px"><strong>Your Task:</strong><br>
You don't need to read or print anyhting. Your task is to complete the function&nbsp;<strong>closestPalindrome()&nbsp;</strong>which takes num as input parameter and returns the closest palindrome.</span><br>
&nbsp;</p>
<p><span style="font-size:18px"><strong>Expected Time Complexity:&nbsp;</strong>O(log<sub>10</sub>num)<br>
<strong>Expected Space Complexity:&nbsp;</strong>O(1)</span><br>
&nbsp;</p>
<p><span style="font-size:18px"><strong>Constraints:</strong><br>
1 &lt;= num &lt;= 10<sup>14</sup></span></p>
 <p></p>
            </div>