<p>Given an integer <code>x</code>, return <code>true</code><em> if </em><code>x</code><em> is a </em><span data-keyword="palindrome-integer"><em><strong>palindrome</strong></em></span><em>, and </em><code>false</code><em> otherwise</em>.</p>

<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>

<pre>
<strong>Input:</strong> x = 121
<strong>Output:</strong> true
<strong>Explanation:</strong> 121 reads as 121 from left to right and from right to left.
</pre>

<p><strong class="example">Example 2:</strong></p>

<pre>
<strong>Input:</strong> x = -121
<strong>Output:</strong> false
<strong>Explanation:</strong> From left to right, it reads -121. From right to left, it becomes 121-. Therefore it is not a palindrome.
</pre>

<p><strong class="example">Example 3:</strong></p>

<pre>
<strong>Input:</strong> x = 10
<strong>Output:</strong> false
<strong>Explanation:</strong> Reads 01 from right to left. Therefore it is not a palindrome.
</pre>

<p>&nbsp;</p>
<p><strong>Constraints:</strong></p>

<ul>
	<li><code>-2<sup>31</sup>&nbsp;&lt;= x &lt;= 2<sup>31</sup>&nbsp;- 1</code></li>
</ul>

<p>&nbsp;</p>
<strong>Follow up:</strong> Could you solve it without converting the integer to a string?
class Solution {
public:
	bool isPalindrome(int x) {

		if ((x < 0) || (x == 10)||x == 100 || x == 1000 || x == 10000 || x == 100000 || x == 1000000) {
			return false;
		}
		if ((x < 10) && (x > 0)) {
			return true;
		}
    

		int b = x;
		int k = 1;
		while (b > 9) {
			b = b / 10;
			k += 1;
		}
		int num1 = x;
		int i = 0;
		int array[99];
		while (x > 0) {
			num1 = x % 10;
			x = x / 10;
			array[i] = num1;
			i++;
		}
		int n = 0;
		int m = 0;
		int res = k / 2;
		while (n < res) {
			int testn1 = array[n];
			int testn2 = array[k - 1];
			if (testn1 == testn2) {
				k -= 1;
				n += 1;
			}
			else {
				return false;
			}

		}
		return true;
	}
};
9800