Go - Pangram Done
This commit is contained in:
20
go/pangram/pangram.go
Normal file
20
go/pangram/pangram.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package pangram
|
||||
|
||||
import "strings"
|
||||
|
||||
const testVersion = 1
|
||||
|
||||
func IsPangram(inp string) bool {
|
||||
used := make(map[rune]int)
|
||||
inp = strings.ToLower(inp)
|
||||
for _, l := range inp {
|
||||
used[l] = used[l] + 1
|
||||
}
|
||||
|
||||
for i := 'a'; i <= 'z'; i++ {
|
||||
if used[i] == 0 {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
Reference in New Issue
Block a user