Java. Minimum Insertion Steps to Make a String Palindrome.
\n\nclass Solution {\n    public int longestPalindromeSubseq(String s) {\n        char []str = s.toCharArray();\n        int [][] answ = new int[s.length() + 1]
\n```\nclass Solution {\n    public int longestPalindromeSubseq(String s) {\n        char []str = s.toCharArray();\n        int [][] answ = new int[s.length() + 1][s.length() + 1];\n        int n = s.length();\n        for(int i = 0; i < s.length(); i++)\n        {\n            for (int j = n - 1; j > -1; j--)\n            {\n                if (str[i] == str[j]) answ[i + 1][n - j] = answ[i - 1 + 1][n - j - 1 ] + 1;\n                else answ[i + 1][n - j ] = Math.max(answ[i - 1 + 1][n - j ], answ[i + 1][n - j - 1]);\n            }\n        }\n        return answ[n][n];\n    }\n    public int minInsertions(String s) {\n        return s.length() - longestPalindromeSubseq(s);\n    }\n}\n```
['Java']