✅✅DAILY LEETCODE SOLUTION || EASY C++ SOLUTION🚀🚀
\n//Memoisation\nclass Solution {\npublic:\n    int fun(int i,int j,string& word1,string& word2,vector<vector<int>> &dp)\n    {\n        if(j<0){\n            r
```\n//Memoisation\nclass Solution {\npublic:\n    int fun(int i,int j,string& word1,string& word2,vector<vector<int>> &dp)\n    {\n        if(j<0){\n            return i+1;\n        }\n        if(i<0){\n            return j+1;\n        }\n        if(dp[i][j]!=-1) return dp[i][j];\n        if(word1[i]==word2[j]){\n            return dp[i][j]=fun(i-1,j-1,word1,word2,dp);\n        }\n        int ins=1+fun(i,j-1,word1,word2,dp);\n        int del=1+fun(i-1,j,word1,word2,dp);\n        int rep=1+fun(i-1,j-1,word1,word2,dp);\n        return dp[i][j]=min(ins,min(del,rep));\n    }\n    int minDistance(string word1, string word2) {\n        int m=word1.size();\n        int n=word2.size();\n        vector<vector<int>> dp(m,vector<int>(n,-1));\n        return fun(m-1,n-1,word1,word2,dp);\n    }\n};\n```\n```\n//Tabulation\nclass Solution {\npublic:\n    int minDistance(string word1, string word2) {\n        int m=word1.size();\n        int n=word2.size();\n        vector<vector<int>> dp(m+1,vector<int>(n+1,0));\n        for(int j=0;j<=n;j++){\n            dp[0][j]=j;\n        }\n        for(int i=0;i<=m;i++){\n            dp[i][0]=i;\n        }\n        for(int i=1;i<=m;i++)\n        {\n            for(int j=1;j<=n;j++){\n                if(word1[i-1]==word2[j-1]){\n                    dp[i][j]=dp[i-1][j-1];\n                    continue;\n                }\n                int ins=1+dp[i][j-1];\n                int del=1+dp[i-1][j];\n                int rep=1+dp[i-1][j-1];\n                dp[i][j]=min(ins,min(del,rep));        \n            }\n        }\n        return dp[m][n];\n    }\n};\n```
['Dynamic Programming', 'Recursion', 'Memoization', 'C']