C++ || Map of each row & column
\nclass Solution {\npublic:\n    int firstCompleteIndex(vector<int>& arr, vector<vector<int>>& mat) {\n        unordered_map<int,pair<int,int>> mp;\n        for
```\nclass Solution {\npublic:\n    int firstCompleteIndex(vector<int>& arr, vector<vector<int>>& mat) {\n        unordered_map<int,pair<int,int>> mp;\n        for(int i=0;i<mat.size();i++){\n            for(int j=0;j<mat[0].size();j++){\n                mp[mat[i][j]] = {i,j};\n            }\n        }\n        map<int,int> r,c;\n        for(int i=0;i<arr.size();i++){\n            auto x = mp[arr[i]];\n            r[x.first] += 1;\n            c[x.second] += 1;\n            \n            if(r[x.first] == mat[0].size() || c[x.second] == mat.size()) return i;\n        }\n        return -1;\n    }\n};\n```
['C', 'C++']