✅Without knowing LCS
Intuition\nStarted thougth process from checking palindrome.\n\n# Approach\n- Approached from checking palindrome.\n- Added base condition.\n- Checked if charac
# Intuition\nStarted thougth process from checking palindrome.\n\n# Approach\n- Approached from checking palindrome.\n- Added base condition.\n- Checked if character are same or not.\n- If not I just take the minimum of moving from both the ends.\n\nAnalyzed all the possibilities came up with ```recursion``` solution, than converted recursion to ```memoization```.\n\n# Complexity\n- Time complexity: $$O(n^2)$$\n\n- Space complexity:$$O(n^2)$$\n\n# Code\n```\nclass Solution {\npublic:\n    int dp[501][501];\n    int solve(string &s, int i, int j){\n        if(i>=j)\n            return 0;\n        if(dp[i][j]!=-1)\n            return dp[i][j];\n        if(s[i]==s[j])\n            return dp[i][j]=solve(s, i+1, j-1);\n        else\n            return dp[i][j]=1+min(solve(s, i+1, j), solve(s, i, j-1));\n        return dp[i][j]=0;\n    }\n    int minInsertions(string s) {\n        memset(dp, -1, sizeof(dp));\n        return solve(s, 0, s.length()-1);\n    }\n};\n```
['Dynamic Programming', 'C++']