python clean recursive solution
Following the same idea from the other post to separate the search space into two parts using the last element to burst. The key with this implementation is to 
Following the same idea from the other post to separate the search space into two parts using the last element to burst. The key with this implementation is to add "[1]" to the beginning and end of the input array to handle ALL the corner cases at ease.\n```\nclass Solution(object):\n    def maxCoins(self, nums):\n        if not nums:\n            return 0\n        nums = [1] + nums + [1]\n        cache = {}\n        return self._maxCoins(nums, 0, len(nums) - 1, cache)\n\n    def _maxCoins(self, nums, left, right, cache):\n        if (left, right) in cache:\n            return cache[(left, right)]\n        maximum = 0\n        for i in range(left + 1, right):\n            maximum = max(maximum, self._maxCoins(nums, left, i, cache) + self._maxCoins(nums, i, right, cache) + nums[left] * nums[i] * nums[right])\n        cache[(left, right)] = maximum\n        return maximum\n\n\n
[]