1
0
Fork 0
mirror of https://gitlab.com/mfocko/CodeWars.git synced 2024-11-24 17:51:56 +01:00

6kyu: add detect pangram

Signed-off-by: Matej Focko <mfocko@redhat.com>
This commit is contained in:
Matej Focko 2021-12-28 18:15:41 +01:00
parent 50425a67ea
commit 3fc8a805ef
No known key found for this signature in database
GPG key ID: 332171FADF1DB90B
2 changed files with 33 additions and 0 deletions

View file

@ -0,0 +1,29 @@
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.

View file

@ -210,6 +210,10 @@
- [Valid Braces](https://www.codewars.com/kata/5277c8a221e209d3f6000b56) - [solution](6kyu/valid_braces) - [Valid Braces](https://www.codewars.com/kata/5277c8a221e209d3f6000b56) - [solution](6kyu/valid_braces)
### Pascal
- [Detect Pangram](https://www.codewars.com/kata/545cedaa9943f7fe7b000048) - [solution](6kyu/detect_pangram)
## 7 kyu ## 7 kyu
### JS ### JS