Medium Accuracy: 49.98%
Submissions: 38997 Points: 4
Given two strings s and t. Find the minimum number of operations that need to be performed on str1 to convert it to str2. The possible operations are:
Insert a character at any position of the string.
Remove any character from the string.
Replace any character from the string with any other character.
s = "geek", t = "gesek"
Explanation: One operation is required
inserting 's' between two 'e's of str1.
s = "gfg", t = "gfg"
Explanation: Both strings are same.
You don't need to read or print anything. Your task is to complete the function editDistance() which takes strings s and t as input parameters and returns the minimum number of operation required to make both strings equal.
Expected Time Complexity: O(|s|*|t|) Expected Space Complexity: O(|s|*|t|)
1 ≤ Length of both strings ≤ 100
Both the strings are in lowercase.