exercism/go/isogram/isogram.go

24 lines
319 B
Go
Raw Normal View History

2016-11-30 03:28:40 +00:00
package isogram
import "strings"
const testVersion = 1
func IsIsogram(inp string) bool {
used := make(map[rune]int)
inp = strings.ToLower(inp)
for _, l := range inp {
switch l {
case '-':
continue
case ' ':
continue
}
if used[l] > 0 {
return false
}
used[l] = used[l] + 1
}
return true
}