publicclassSolution {publicbooleanisPalindrome(int x) {if (x <0) {returnfalse; }int div =1;while (x / div >=10) { div *=10; }while (x !=0) {int left = x / div; // get highest pos;int right = x %10; // git lowest pos;if (left != right) {returnfalse; } x = (x % div) /10; div = div /100; }returntrue; }}