Tap here to switch tabs
Problem
Submissions

Problem: Edit Distance

Edit Distance gives you two strings and asks you to return the minimum number of operations needed to transform one into the other using character insertions, deletions, or replacements.

Statement

Given two strings word1 and word2, return the minimum number of operations needed to transform word1 into word2.

The following three operations are allowed on any character of a word:

  • Insert a character

  • Delete a character

  • Replace a character

Constraints:

  • 0≤0 \leq word1.length, word2.length ≤500\leq 500

  • word1 and word2 consist of lowercase English letters

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Edit Distance

Edit Distance gives you two strings and asks you to return the minimum number of operations needed to transform one into the other using character insertions, deletions, or replacements.

Statement

Given two strings word1 and word2, return the minimum number of operations needed to transform word1 into word2.

The following three operations are allowed on any character of a word:

  • Insert a character

  • Delete a character

  • Replace a character

Constraints:

  • 0≤0 \leq word1.length, word2.length ≤500\leq 500

  • word1 and word2 consist of lowercase English letters