Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,37 @@
package main
import "fmt"
func main() {
for _, s := range []string{
"The quick brown fox jumps over the lazy dog.",
`Watch "Jeopardy!", Alex Trebek's fun TV quiz game.`,
"Not a pangram.",
} {
if pangram(s) {
fmt.Println("Yes:", s)
} else {
fmt.Println("No: ", s)
}
}
}
func pangram(s string) bool {
var missing uint32 = (1 << 26) - 1
for _, c := range s {
var index uint32
if 'a' <= c && c <= 'z' {
index = uint32(c - 'a')
} else if 'A' <= c && c <= 'Z' {
index = uint32(c - 'A')
} else {
continue
}
missing &^= 1 << index
if missing == 0 {
return true
}
}
return false
}