-
-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
False positive on solution: https://exercism.io/mentor/solutions/6356bab9214544fe85b37b0c646c183b?iteration_idx=3
package isogram
import (
"strings"
"unicode"
)
//IsIsogram returns true if string is isogram
func IsIsogram(word string) bool {
wordUpper := strings.ToUpper(word)
for i := 0; i < len(wordUpper); i++ {
if unicode.IsLetter(rune(wordUpper[i])) {
if strings.Count(wordUpper, string(wordUpper[i])) > 1 {
return false
}
}
}
return true
}Wrong output:
- If you're declaring a variable which can be initialized with its zero value, then
var s stringis more idiomatic than an assignment:s := "".
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels