class Solution { /** * Find the LCS of both strings * Once LCS length is found, we can remove the length of LCS from both the strings * and then we can sum up the remaining length of both strings */ public int minDistance(String word1, String word2) { int n = word1.length(); int m = word2.length(); int[][] t = new int[n+1][m+1]; for(int i=0; i