Determine whether an integer is a palindrome. Do this without extra space.
defisPalindrome(x: Int): Boolean = {if (x <0|| (x !=0&& x %10==0)) falseelse {var _x = xvar res =0while (x > res) { res = res *10+ _x %10 _x /=10 } x == res || x == res /10 }}