[ Python ] ✅✅ Simple Python Solution Using Dynamic Programming🥳✌👍
If You like the Solution, Don\'t Forget To UpVote Me, Please UpVote! \uD83D\uDD3C\uD83D\uDE4F\n# Runtime: 1317 ms, faster than 27.39% of Python3 online submissi
# If You like the Solution, Don\'t Forget To UpVote Me, Please UpVote! \uD83D\uDD3C\uD83D\uDE4F\n# Runtime: 1317 ms, faster than 27.39% of Python3 online submissions for Minimum Insertion Steps to Make a String Palindrome.\n# Memory Usage: 16 MB, less than 67.55% of Python3 online submissions for Minimum Insertion Steps to Make a String Palindrome.\n\n\tclass Solution:\n\t\tdef minInsertions(self, s: str) -> int:\n\n\t\t\tdef LeastCommonSubsequence(string, reverse_string, row, col):\n\n\t\t\t\tdp = [[0 for _ in range(col + 1)] for _ in range(row + 1)]\n\n\t\t\t\tfor r in range(1, row + 1):\n\t\t\t\t\tfor c in range(1, col + 1):\n\n\t\t\t\t\t\tif string[r - 1] == reverse_string[c - 1]:\n\n\t\t\t\t\t\t\tdp[r][c] = dp[r - 1][c - 1] + 1\n\n\t\t\t\t\t\telse:\n\t\t\t\t\t\t\tdp[r][c] = max(dp[r - 1][c] , dp[r][c - 1])\n\n\t\t\t\treturn dp[row][col]\n\n\t\t\tlength = len(s)\n\n\t\t\tresult = length - LeastCommonSubsequence(s , s[::-1] , length , length)\n\n\t\t\treturn result\n\t\t\t\n# Thank You \uD83E\uDD73\u270C\uD83D\uDC4D
['Dynamic Programming', 'Memoization', 'Python', 'Python3']