✔ Where Will the Ball Fall || [C++] Iterative Solution || Easy
\nvector<int> findBall(vector<vector<int>>& grid) {\n        int row = grid.size();\n        int col = grid[0].size();\n        vector<int>res(col);\n        fo
```\nvector<int> findBall(vector<vector<int>>& grid) {\n        int row = grid.size();\n        int col = grid[0].size();\n        vector<int>res(col);\n        for (int i = 0; i < col; ++i) {\n            int currRow = 0, currCol = i;\n            while (currRow < row) {\n\n                if (grid[currRow][currCol] == 1&&currCol + 1 < col && grid[currRow][currCol + 1] == 1){\n\t\t\t\t\t// We go to the right if the current value and the value to the right are both equal to 1.\n\t\t\t\t\t// i.e  \'\\ \\\'\n                    currCol++; currRow++;\n                } \n                else if (grid[currRow][currCol]==-1 &&currCol - 1 >= 0&&grid[currRow][currCol-1]== -1){\n\t\t\t\t\t //We go to the left if the current value and the value to the left are both equal to -1.\n\t\t\t\t\t //i.e \' / /\'\n                    currCol--; currRow++;\n                } \n                else {\n\t\t\t\t// the ball is stuck because there is no other way to move. \n\t\t\t\t//i.e \\/\n                    break; \n                }\n            }\n            res[i] = currRow == row ? currCol : -1;\n        }\n        return res;\n        \n    }\n```
['Iterator', 'C++']