We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0bb4bbf commit 7731e8fCopy full SHA for 7731e8f
topics/go/algorithms/numbers/palindrome/palindrome.go
@@ -5,17 +5,17 @@ import "github.com/ardanlabs/gotraining/topics/go/algorithms/numbers/reverse"
5
// Is checks if a integer is a Palindrome.
6
func Is(input int) bool {
7
8
- // Integer below zero cannot be palindrome.
+ // An negative integer is not a palindrome.
9
if input < 0 {
10
return false
11
}
12
13
- // A integer is a palindrome if it has the value between 0 and 9.
+ // An integer that is only one digit in length is a palindrome.
14
if input >= 0 && input < 10 {
15
return true
16
17
18
- // Get the reverse integer.
+ // Reverse the digits in the integer.
19
rev := reverse.Reverse(input)
20
21
return input == rev
0 commit comments