We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a1cdbce commit dc02f1eCopy full SHA for dc02f1e
pystrings/similar_string_groups/__init__.py
@@ -36,8 +36,9 @@ def is_similar(s1: str, s2: str) -> bool:
36
j = positions_that_differ[1]
37
return s1[i] == s2[j] and s1[j] == s2[i]
38
39
- # Must have 0 diffs (identical) or 2 diffs (one swap)
40
- return diff_count == 0 or diff_count == 2
+ # At this point, diff_count is either 0 or 1
+ # Only 0 differences (identical strings) are similar
41
+ return diff_count == 0
42
43
# Iterate over all unique pairs of strings
44
for i in range(strs_len):
0 commit comments