Easy || Beginner's Friendly || Easy to Understand || ✅✅
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public int minInsertions(String s) {\n        int dp[][]=new int[s.length()+1][s.length()+1];\n        for(int i=1;i<dp.length;i++){\n            for(int j=1;j<dp[0].length;j++){\n                if(s.charAt(i-1)==s.charAt(s.length()-j)){\n                    dp[i][j]=dp[i-1][j-1]+1;\n                }\n                else{\n                    dp[i][j]=Math.max(dp[i-1][j],dp[i][j-1]);\n                }\n            }\n        }\n        return s.length()-dp[dp.length-1][dp[0].length-1];\n    }\n}\n```
['Java']