We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 4dbd2cc + be9dca4 commit 8402beaCopy full SHA for 8402bea
go/0009-palindrome-number.go
@@ -0,0 +1,10 @@
1
+func isPalindrome(x int) bool {
2
+ s := strconv.Itoa(x)
3
+ r := []rune(s)
4
+ for i, j := 0, len(r)-1; i < j; i, j = i+1, j-1 {
5
+ if r[i] != r[j] {
6
+ return false
7
+ }
8
9
+ return true
10
+}
0 commit comments