Skip to content

Commit d7a532d

Browse files
author
Milad Khoshdel
committed
Performance: Remove unnecessary sorting from is_isogram()
1 parent d04b15b commit d7a532d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

strings/is_isogram.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def is_isogram(string: str) -> bool:
1919
if not all(x.isalpha() for x in string):
2020
raise ValueError("String must only contain alphabetic characters.")
2121

22-
letters = sorted(string.lower())
22+
letters = string.lower()
2323
return len(letters) == len(set(letters))
2424

2525

0 commit comments

Comments
 (0)