Back to problems

Edit Distance (LC 72) with a Follow-Up Variant

Algorithm · Amazon · Hard

Edit Distance Medium · Dynamic Programming, String · Company Tags · Hints You are given two strings s and t. You can edit s using any of three elementary operations: inserting a single character anywhere, deleting any one character, or replacing one character with another. Find the minimum number of such operations required to change s into t. Example 1: Explanation: Replace the first character ‘a’ with ‘b’, and replace ‘b’ with ‘a’, achieving the transformation in two…

Checking your access…