Leetcode, Scala, Palindrome Number, Programming, Technical Interview.
the number and comparing it with the first half. Scala Code object Solution { def isPalindrome(x: Int): Boolean = { if (x < 0 || (x % 10 == 0 && x != 0)) return false var revertedNumber = 0 var y = x while (y > revertedNumber) { revertedNumber = revertedNumber * 10 + y % 10 y /= 10 } y ==