mirror of
https://codeberg.org/andyscott/exercism.git
synced 2024-11-09 21:30:47 -05:00
19 lines
350 B
Zig
19 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;
|
||
|
}
|