mirror of
https://gitlab.com/mfocko/CodeWars.git
synced 2024-11-08 18:49:07 +01:00
29 lines
454 B
ObjectPascal
29 lines
454 B
ObjectPascal
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.
|