1
0
Fork 0
mirror of https://gitlab.com/mfocko/CodeWars.git synced 2024-11-09 11:09:07 +01:00
CodeWars/6kyu/detect_pangram/solution.pas
Matej Focko 3fc8a805ef
6kyu: add detect pangram
Signed-off-by: Matej Focko <mfocko@redhat.com>
2021-12-28 18:15:41 +01:00

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.