mirror of
https://codeberg.org/andyscott/exercism.git
synced 2024-12-22 14:43:10 -05:00
18 lines
350 B
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;
|
|
}
|