[Python3] prefix sums
Please pull this commit for solutions of weekly 289. \n\n\nclass Solution:\n    def maxTrailingZeros(self, grid: List[List[int]]) -> int:\n        m, n = len(gr
Please pull this [commit](https://github.com/gaosanyong/leetcode/commit/fa812e3571831f574403ed3a69099f6cfc5ec5a5) for solutions of weekly 289. \n\n```\nclass Solution:\n    def maxTrailingZeros(self, grid: List[List[int]]) -> int:\n        m, n = len(grid), len(grid[0])\n        f2 = [[0]*n for _ in range(m)]\n        f5 = [[0]*n for _ in range(m)]\n        for i in range(m): \n            for j in range(n): \n                x = grid[i][j]\n                while x % 2 == 0: \n                    f2[i][j] += 1\n                    x //= 2 \n                x = grid[i][j]\n                while x % 5 == 0: \n                    f5[i][j] += 1\n                    x //= 5 \n        \n        h = [[[0, 0] for j in range(n+1)] for i in range(m+1)]\n        v = [[[0, 0] for j in range(n+1)] for i in range(m+1)]\n\n        for i in range(m): \n            for j in range(n): \n                h[i][j+1][0] = h[i][j][0] + f2[i][j]\n                h[i][j+1][1] = h[i][j][1] + f5[i][j]\n                v[i+1][j][0] = v[i][j][0] + f2[i][j]\n                v[i+1][j][1] = v[i][j][1] + f5[i][j]\n        \n        ans = 0 \n        for i in range(m): \n            for j in range(n): \n                hh = [h[i][n][0] - h[i][j][0], h[i][n][1] - h[i][j][1]]\n                vv = [v[m][j][0] - v[i][j][0], v[m][j][1] - v[i][j][1]]\n                ans = max(ans, min(h[i][j][0]+v[i][j][0]+f2[i][j], h[i][j][1]+v[i][j][1]+f5[i][j]))\n                ans = max(ans, min(h[i][j][0]+vv[0], h[i][j][1]+vv[1]))\n                ans = max(ans, min(hh[0]+v[i][j][0], hh[1]+v[i][j][1]))\n                ans = max(ans, min(hh[0]+vv[0]-f2[i][j], hh[1]+vv[1]-f5[i][j]))\n        return ans\n```
['Python3']