Using dynamic Programing(Tabulation).
Intuition\n Describe your first thoughts on how to solve this problem. \nIf we find the longest length of the character which are palindrome then we have to do 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nIf we find the longest length of the character which are palindrome then we have to do only insertion for those who are not palindrome.\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nMin insertions equal the difference in total length of string and length of longest palindrome sequence as we have to only repeat these elements in reversed order to make it a palindrome.\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nO(N*M) where n is the len of string and m is the len of reversed string.\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(N*M)\n\n# Code\n```\nclass Solution:\n    def minInsertions(self, s: str) -> int:\n        n = len(s)\n        k = self.longestPalindromeSubseq(s)\n        return n -k\n    # Helper functions\n    def longestPalindromeSubseq(self, s: str) -> int:\n        # can find the longest palindrome by reversing the string and and using longest common subsequence\n        t = s \n        # Reversing the string\n        s = s[::-1]\n        return self.lcs(s,t)\n    def lcs(self, text1: str, text2: str) -> int:\n        # Using tabulation\n        n = len(text1)\n        m = len(text2)\n        # Creating the dp matrix with changing variables\n        dp = [[-1 for _ in range(m+1)]for _ in range(n+1)]\n        # base cases\n        # if any of the index is zero means we have nothing left we compare so return 0.\n        for j in range(m+1):\n            dp[0][j] == 0\n        for i in range(n+1):\n            dp[i][0] == 0\n        # considered the 0 above so start the itereation from 1\n        for i in range(1,n+1):\n            for j in range(1,m+1):\n                # If the character match then add 1 and move 1 step\n                if text1[i-1] == text2[j-1]:\n                    dp[i][j] = 1 + dp[i-1][j-1]\n                # If not match then find the max by moving 1 step ahead in string 1 or moving 1 step ahead in string 2\n                else:\n                    dp[i][j] = max(dp[i-1][j],dp[i][j-1])\n        return dp[n][m] +1\n        \n```
['Python3']