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