Skip to content

Commit 59760f7

Browse files
Ankush263github-actions
andauthored
merge: Add test case to Edit Distance Algorithm (TheAlgorithms#1044)
* Add test case to Edit Distance Algorithm * Updated Documentation in README.md Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
1 parent f5be6b2 commit 59760f7

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { minimumEditDistance } from '../EditDistance'
2+
3+
test('minimumEditDistance(kitten, sitten) => 1', () => {
4+
const str1 = 'kitten'
5+
const str2 = 'sitten'
6+
const res = minimumEditDistance(str1, str2)
7+
expect(res).toEqual(1)
8+
})
9+
10+
test('minimumEditDistance(school, skull) => 4', () => {
11+
const str1 = 'school'
12+
const str2 = 'skull'
13+
const res = minimumEditDistance(str1, str2)
14+
expect(res).toEqual(4)
15+
})
16+
17+
test('minimumEditDistance(Algorithm, Algorithm) => 0', () => {
18+
const str1 = 'Algorithm'
19+
const str2 = 'Algorithm'
20+
const res = minimumEditDistance(str1, str2)
21+
expect(res).toEqual(0)
22+
})

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy