✅ easy solution in c++
\nclass Solution {\npublic:\n    int n,m;\n    \n    int findBallDropColumn(int row, int col, vector<vector<int>>& grid) {\n        // base case; ball reached t
```\nclass Solution {\npublic:\n    int n,m;\n    \n    int findBallDropColumn(int row, int col, vector<vector<int>>& grid) {\n        // base case; ball reached the last row\n        if (row == n) return col;\n        int nextColumn = col + grid[row][col];\n        if (nextColumn < 0 || nextColumn > m - 1 ||\n            grid[row][col] != grid[row][nextColumn]) {\n            return -1;\n        }\n        return findBallDropColumn(row + 1, nextColumn, grid);\n    }\n    vector<int> findBall(vector<vector<int>>& grid) {\n        n=grid.size();\n        m=grid[0].size();\n        vector<int> ans;\n        for(int i=0;i<m;i++){\n            int f=findBallDropColumn(0,i,grid);\n            ans.push_back(f);\n        }\n        return ans;\n    }\n};\n\n```
['Dynamic Programming', 'C', 'C++']