Skip to content

Commit 12159f9

Browse files
committed
Added edit_distance test cases
1 parent 4ec71a3 commit 12159f9

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

strings/edit_distance.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,20 @@ def edit_distance(source: str, target: str) -> int:
1414
1515
>>> edit_distance("GATTIC", "GALTIC")
1616
1
17+
>>> edit_distance("NUM3", "HUM2")
18+
2
19+
>>> edit_distance("cap","CAP")
20+
3
21+
>>> edit_distance("Cat","")
22+
3
23+
>>> edit_distance("cat","cat")
24+
0
25+
>>> edit_distance("","123456789")
26+
9
27+
>>> edit_distance("Be@uty","Beautyyyy!")
28+
5
29+
>>> edit_distance("lstring","lsstring")
30+
1
1731
"""
1832
if len(source) == 0:
1933
return len(target)

0 commit comments

Comments
 (0)