Go solution
\nfunc walk(grid [][]int, x, y int) int {\n\tif y == len(grid) {\n\t\treturn x\n\t}\n\tif grid[y][x] == 1 {\n\t\tif x == len(grid[y])-1 || grid[y][x+1] == -1 {\
```\nfunc walk(grid [][]int, x, y int) int {\n\tif y == len(grid) {\n\t\treturn x\n\t}\n\tif grid[y][x] == 1 {\n\t\tif x == len(grid[y])-1 || grid[y][x+1] == -1 {\n\t\t\treturn -1\n\t\t}\n\t\treturn walk(grid, x+1, y+1)\n\t}\n\tif x == 0 || grid[y][x-1] == 1 {\n\t\treturn -1\n\t}\n\treturn walk(grid, x-1, y+1)\n}\n\nfunc findBall(grid [][]int) []int {\n\tvar (\n\t\tanswer = make([]int, len(grid[0]))\n\t)\n\tfor i := 0; i < len(answer); i++ {\n\t\tanswer[i] = walk(grid, i, 0)\n\t}\n\treturn answer\n}\n```
['Go']