Python 3| Clean code with explanation.
Intuition\n Describe your first thoughts on how to solve this problem. \nA huge observation here is that all three kids are going independantly. This means that
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n**A huge observation here is that all three kids are going independantly.** This means that, in order to solve this problem we can use the same approach we use to solve a falling sum problem. \n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n1. The first kid has always go diagonale because otherwise he cannot make it to the bottom right coner in n-1 steps. So we calculate the number of fruits he takes on his way, and remove them from the cells for other kids.\n2. Using a falling sum approach we calculate the maximimum number of fruits for the boy in the top right coner.\n3. Using the same approach we calucalate the number of fruits for the kid in the bottom left corner. \n# Complexity\n- Time complexity: $$O(n ^2)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:$$O(n^2)$$\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        result = 0\n        for i in range(len(fruits)):\n            result += fruits[i][i]\n            fruits[i][i] = 0\n        \n        dp_1 = [[0] * (len(fruits) + 1) for _ in range(len(fruits) + 1)]\n        dp_1[1][-2] = fruits[0][-1]\n\n        for i in range(1, len(dp_1)):\n            for j in range(len(fruits) - i, len(fruits)):\n                dp_1[i][j] = max(dp_1[i - 1][j - 1], dp_1[i - 1][j], dp_1[i - 1][j + 1]) + fruits[i - 1][j]\n\n        dp_2 = [[0] * len(fruits) for _ in range(len(fruits) + 1)]\n        dp_2[-2][0] = fruits[-1][0]\n\n        for j in range(1, len(dp_2[0])):\n            for i in range(len(fruits) - j - 1, len(fruits)):\n                dp_2[i][j] = max(dp_2[i - 1][j - 1], dp_2[i][j - 1], dp_2[i + 1][j - 1]) + fruits[i][j]\n\n        return result + dp_1[-1][-2] + dp_2[-2][-1]\n    \n```\n\nFalling sum problem: https://leetcode.com/problems/minimum-falling-path-sum/description/
['Dynamic Programming', 'Python3']