C++ Easy solution || Faster than 95% || DFS
\nclass Solution {\npublic:\n    int R, C;\n    int dfs(vector<vector<int>>& grid, int r, int c, int from) {\n        if (r == R) return c;\n        if (c == C 
```\nclass Solution {\npublic:\n    int R, C;\n    int dfs(vector<vector<int>>& grid, int r, int c, int from) {\n        if (r == R) return c;\n        if (c == C or c < 0) return -1;\n        if (from == 0) {\n            if (grid[r][c] == 1) return dfs(grid, r, c+1, 1);\n            else return dfs(grid, r, c-1, 3);\n        } else if (from == 1) {\n            if (grid[r][c] == 1) return dfs(grid, r+1, c, 0);\n            else return -1;\n        } else {\n            if (grid[r][c] == 1) return -1;            \n\t\t\telse return dfs(grid, r+1, c, 0);\n        }\n    }\n    vector<int> findBall(vector<vector<int>>& grid) {\n        R = grid.size();\n        C = grid[0].size();\n        vector<int> ans;\n        for (int i=0; i<C; i++) {\n            auto r = dfs(grid, 0, i, 0);\n            ans.push_back(r);\n        }\n        return ans;\n    }\n};\n```
['Depth-First Search', 'C', 'C++']