mirror of
https://codeberg.org/andyscott/exercism.git
synced 2024-11-09 13:20:48 -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;
|
|
}
|