exercism/zig/pangram/pangram.zig

18 lines
350 B
Zig

const ascii = @import("std").ascii;
pub fn isPangram(str: []const u8) bool {
var alphabet = [_]u8{0} ** 26;
for (str) |c| {
if (!ascii.isAlphabetic(c)) {
continue;
}
alphabet[ascii.toLower(c) - 97] += 1;
}
for (alphabet) |count| {
if (count == 0) return false;
}
return true;
}