Easy Solution
Intuition\n Describe your first thoughts on how to solve this problem. \n#### First guy will only move along primary diagonal\n#### Second guy cannot cross prim
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n#### First guy will only move along primary diagonal\n#### Second guy cannot cross primary diagonal, it has to move down maximizing fruits.\n#### Third guy cannot cross primary diagonal, it has to move right maximizing fruits.\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: List[List[int]]) -> int:\n        p1=0\n        for i in range(len(fruits)):\n            p1+=fruits[i][i]\n\n        self.mem={}\n\n        def pp2(i,j):\n            if i>=0 and i<len(fruits) and j<len(fruits) and j>=0 and j>i:\n                if i==len(fruits) and i==j:\n                    return 0\n                if (i,j) in self.mem:\n                    return self.mem[(i,j)]\n                self.mem[(i,j)]=fruits[i][j]+max(pp2(i+1,j),pp2(i+1,j-1),pp2(i+1,j+1))\n                return self.mem[(i,j)]\n            else:\n                return 0\n\n        self.mem1={}\n\n        def pp3(i,j):\n            if i>=0 and i<len(fruits) and j<len(fruits) and j>=0 and i>j:\n                if i==len(fruits)-1 and i==j:\n                    return 0\n                if (i,j) in self.mem1:\n                    return self.mem1[(i,j)]\n                self.mem1[(i,j)]=fruits[i][j]+max(pp3(i-1,j+1),pp3(i,j+1),pp3(i+1,j+1))\n                return self.mem1[(i,j)]\n            else:\n                return 0\n                \n        p2=pp2(0,len(fruits)-1)\n        p3=pp3(len(fruits)-1,0)\n        # print(self.mem)\n        # print(self.mem1)\n        # print(p1)\n        # print(p2)\n        # print(p3)\n        return p1+p2+p3\n```
['Python3']