Python 3   ||   12 lines, simulation, w/explanation  || T/S: 94% / 71%
\nclass Solution:\n    def findBall(self, grid: List[List[int]]) -> List[int]:\n\n        m,n = len(grid), len(grid[0])       # comments added nov 1 22 for @flu
```\nclass Solution:\n    def findBall(self, grid: List[List[int]]) -> List[int]:\n\n        m,n = len(grid), len(grid[0])       # comments added nov 1 22 for @flufe (see below)\n        N, ans = range(n), []\n                              \n        for pos in N:                       # for each ball in the top row...                         \n            for row in grid:                #     for each row....\n\n                direction = row[pos]        # +1 to the right, -1 to the left\n                pos += row[pos]             # move the ball left or right\n                                    \n                if (pos not in N or         # if the ball runs into wall or...\n                    row[pos] != direction): # ... if the ball runs into \\/, then...\n                    ans.append(-1)          # ...start the next ball. Otherwise, ball moves down a row\n                    break                \n            else:\n                ans.append(pos)             # if tha ball does not fail, record its exit position\n                       \n        return ans                          # return the list of results\n```\n\n[https://leetcode.com/problems/where-will-the-ball-fall/submissions/1279966648/](https://leetcode.com/problems/where-will-the-ball-fall/submissions/1279966648/)\n\nI could be wrong, but I think that time complexity is *O*(*MN*) and space complexity is *O*(*N*), in which *M*, *N* ~ `m`, `n`.
['Python', 'Python3']