⭐✅Clean, Simple & Easy C++ Code💯 || Memoization✅
Code\n## Please Upvote if u liked my Solution\uD83E\uDD17\n\nclass Solution {\npublic:\n    int helper(int i,int j,string& s,vector<vector<int>>& dp){\n        
# Code\n## Please Upvote if u liked my Solution\uD83E\uDD17\n```\nclass Solution {\npublic:\n    int helper(int i,int j,string& s,vector<vector<int>>& dp){\n        if(i >= j)\n            return 0;\n        if(dp[i][j] != -1)\n            return dp[i][j];\n        int left = INT_MAX,right = INT_MAX;\n        if(s[i] == s[j])\n            left = helper(i+1,j-1,s,dp);\n        else{\n            left = 1 + helper(i+1,j,s,dp);\n            right = 1 + helper(i,j-1,s,dp);\n        }\n        return dp[i][j] = min(left,right);\n    }\n    int minInsertions(string s) {\n        int n = s.size();\n        vector<vector<int>> dp(n+1,vector<int>(n+1,-1));\n        return helper(0,n-1,s,dp);\n    }\n};\n```\n![e2515d84-99cf-4499-80fb-fe458e1bbae2_1678932606.8004954.png](https://assets.leetcode.com/users/images/f2368f92-ed3e-438c-b19e-dfa2e0bc8b4f_1682151400.3281825.png)\n
['String', 'Dynamic Programming', 'Memoization', 'C++']