Skip to content

Commit 2fdb210

Browse files
authored
Merge branch 'master' into add_kmeans++
2 parents 765c4e7 + 8d1fb26 commit 2fdb210

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ repos:
1616
- id: auto-walrus
1717

1818
- repo: https://github.com/astral-sh/ruff-pre-commit
19-
rev: v0.13.0
19+
rev: v0.13.1
2020
hooks:
2121
- id: ruff-check
2222
- id: ruff-format
@@ -47,7 +47,7 @@ repos:
4747
- id: validate-pyproject
4848

4949
- repo: https://github.com/pre-commit/mirrors-mypy
50-
rev: v1.18.1
50+
rev: v1.18.2
5151
hooks:
5252
- id: mypy
5353
args:

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)