From 3feba01c4b473e9035157a69748d2966d5899a45 Mon Sep 17 00:00:00 2001 From: Rami Chasygov Date: Sat, 6 Aug 2022 23:26:13 +0300 Subject: [PATCH] fix: typo (#352) --- src/dynamic_programming/edit_distance.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dynamic_programming/edit_distance.rs b/src/dynamic_programming/edit_distance.rs index e862ec7eb9e..913d58c87ed 100644 --- a/src/dynamic_programming/edit_distance.rs +++ b/src/dynamic_programming/edit_distance.rs @@ -76,7 +76,7 @@ pub fn edit_distance_se(str_a: &str, str_b: &str) -> u32 { min(c + 1, distances[j] + 1), ); // c is updated to distances[i][j], and will thus become distances[i][j-1] for the next cell - s = distances[j]; // here distances[j] means distances[i-1][j] becuase it has not been overwritten yet + s = distances[j]; // here distances[j] means distances[i-1][j] because it has not been overwritten yet // s is updated to distances[i-1][j], and will thus become distances[i-1][j-1] for the next cell distances[j] = c; // now distances[j] is updated to distances[i][j], and will thus become distances[i-1][j] for the next ROW }