24 lines
319 B
Go
24 lines
319 B
Go
|
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
|
||
|
}
|