Skip to content

Commit 24ada2f

Browse files
committed
suggestion_list: fix transposition cost
Replicates graphql/graphql-js@02cd678
1 parent 50a6c2e commit 24ada2f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/graphql/pyutils/suggestion_list.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,6 @@ def measure(self, option: str):
7070
d[i][j] = min(d[i - 1][j] + 1, d[i][j - 1] + 1, d[i - 1][j - 1] + cost)
7171

7272
if i > 1 and j > 1 and a[i - 1] == b[j - 2] and a[i - 2] == b[j - 1]:
73-
d[i][j] = min(d[i][j], d[i - 2][j - 2] + cost)
73+
d[i][j] = min(d[i][j], d[i - 2][j - 2] + 1)
7474

7575
return d[a_len][b_len]

0 commit comments

Comments
 (0)