Skip to content

Commit 8402bea

Browse files
authored
Merge pull request #1638 from tahsintunan/9
Create 9. Palindrome Number
2 parents 4dbd2cc + be9dca4 commit 8402bea

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

go/0009-palindrome-number.go

+10
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)