[ C ++ ] Easy Solution || DFS
Idea :\nIf current grid pgrid[r][c] is a \\ then check it\'s right column -> grid[r][c+1] is same or not  and Go to it\'s digonal place -> grid[r+1][c+1] else r
**Idea :**\nIf current grid p**grid[r][c]** is a **\\\\** then check it\'s right column **-> grid[r][c+1]** is same or not  and Go to it\'s digonal place **-> grid[r+1][c+1]** else return -1 from there\nand if it is **/** then check it\'s left column **grid[r][c-1]** is same or not if it same then go **-> grid[r+1][c-1]** else  return -1 from there\n If You reach last Row return Column Number **<<<------- Do this task for each column** \n\n```\nclass Solution {\npublic:\n    bool valid(int rsize,int csize,int r,int c){\n        if(rsize<=r||csize<=c||c<0||r<0)return false;\n        return true;\n    }\n    int DFS(vector<vector<int>>& grid,int r,int c){\n        if(r==grid.size())return c;\n        if(valid(grid.size(),grid[0].size(),r,c)){\n            if(grid[r][c]==1){\n                if(valid(grid.size(),grid[0].size(),r,c+1)&&grid[r][c+1]==1){\n                    return DFS(grid,r+1,c+1);\n                }\n            }else{\n                if(valid(grid.size(),grid[0].size(),r,c-1)&&grid[r][c-1]==-1){\n                    return DFS(grid,r+1,c-1);\n                }\n            }\n        }\n        return -1;\n    }\n    vector<int> findBall(vector<vector<int>>& grid){\n        int row = grid.size(),col = grid[0].size();\n        vector<int>ans(col,0);\n        for(int c = 0;c<col;c++){\n            ans[c] = DFS(grid,0,c);\n        }\n    return ans;\n    }\n};\n```\n\n**Thank You**\n**Any doubt ask there**\n**please UpVote**
[]