|
|
|
@ -3,9 +3,9 @@ package palindromenumber
|
|
|
|
|
import "strconv"
|
|
|
|
|
|
|
|
|
|
func isPalindrome(x int) bool {
|
|
|
|
|
str := strconv.Itoa(x)
|
|
|
|
|
str := []rune(strconv.Itoa(x))
|
|
|
|
|
for i, digit := range str {
|
|
|
|
|
if byte(digit) != str[len(str)-i-1] {
|
|
|
|
|
if digit != str[len(str)-i-1] {
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|