1
0
Fork 0
mirror of https://gitlab.com/mfocko/CodeWars.git synced 2024-09-19 22:16:57 +02:00
CodeWars/6kyu/detect_pangram/solution.pas

30 lines
454 B
ObjectPascal
Raw Normal View History

unit Kata;
interface
function IsPangram (s: string): boolean;
implementation
function IsPangram (s: string): boolean;
var
i: integer;
stringSize: integer;
letters: integer = 0;
begin
s := LowerCase(s);
stringSize := Length(s);
for i := 1 to stringSize do
begin
if (s[i] < 'a') or (s[i] > 'z') then
continue;
letters := letters or (1 << (Ord(s[i]) - Ord('a')));
end;
IsPangram := letters = (1 << 26) - 1;
end;
end.