Python (Simple DP)
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```python3 []\nclass Solution:\n    def maxCollectedFruits(self, fruits):\n        n, total = len(fruits), 0 \n\n        for i in range(n):\n            for j in range(n):\n                if i == j:\n                    total += fruits[i][j]\n                    fruits[i][j] = 0 \n\n        @lru_cache(None)\n        def function(i,j,k):\n            if i >= n or i < 0 or j >= n or i-j <= 0 or k <= 0:\n                return 0 \n            return fruits[i][j] + max(function(i-1,j+1,k),function(i,j+1,k),function(i+1,j+1,k))\n        \n        @lru_cache(None)\n        def kunction(i,j,k):\n            if i >= n or j >= n or j < 0 or i-j >= 0 or k <= 0:\n                return 0 \n            return fruits[i][j] + max(kunction(i+1,j-1,k),kunction(i+1,j,k),kunction(i+1,j+1,k))\n\n        return total + function(n-1,0,n-1) + kunction(0,n-1,n-1)\n\n        \n\n            \n\n```
['Python3']