Skip to content

Commit 5352caf

Browse files
committed
determine if two strings are close - improve by deleting lines
1 parent dd6533a commit 5352caf

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

2024/determine_if_two_strings_are_close.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ def closeStrings(self, word1: str, word2: str) -> bool:
1515
char_dict1 = Counter(word1)
1616
char_dict2 = Counter(word2)
1717

18-
if (char_dict1.keys() != char_dict2.keys()):
19-
return False
20-
2118
if (sorted(char_dict1.values()) != sorted(char_dict2.values())):
2219
return False
2320

0 commit comments

Comments
 (0)