Python: isogram
This commit is contained in:
parent
7cf9d0f24d
commit
6223031c18
4 changed files with 126 additions and 0 deletions
14
python/isogram/isogram.py
Normal file
14
python/isogram/isogram.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
def is_isogram(string):
|
||||
|
||||
seen_chars = set()
|
||||
|
||||
for ch in string.lower():
|
||||
if not ch.isalpha():
|
||||
continue
|
||||
|
||||
if ch in seen_chars:
|
||||
return False
|
||||
|
||||
seen_chars.add(ch)
|
||||
|
||||
return True
|
||||
Loading…
Add table
Add a link
Reference in a new issue