Skip to content

Commit 83a24e1

Browse files
committed
Clean up problem 9
1 parent b7c0147 commit 83a24e1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

9.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ import (
66
)
77

88
func isPalindrome(x int) bool {
9-
// Convert the int to a string
109
x_str := strconv.Itoa(x)
1110
length_of_x := len(x_str)
1211

1312
halfway := length_of_x / 2
13+
end_index := length_of_x - 1
1414

15-
for i := 0; i < halfway; i++ {
16-
if x_str[i] != x_str[length_of_x-i-1] {
15+
for index := 0; index < halfway; index++ {
16+
if x_str[index] != x_str[end_index-index] {
1717
return false
1818
}
1919
}

0 commit comments

Comments
 (0)