✅C++ || Hash Table✅
Complexity\n- Time complexity:O(n)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity:O(n)\n Add your space complexity here, e.g. O(n) \n\n# Code
# Complexity\n- Time complexity:`O(n)`\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:`O(n)`\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n\n    int row_Size , col_Size;\n\n    bool isFilled(vector<int>&rows,int curr_Row , vector<int>&columns , int curr_Col){\n\n        if(rows[curr_Row] == col_Size || columns[curr_Col] == row_Size) return true;\n        return false;\n        \n    }\n\n    int firstCompleteIndex(vector<int>& nums, vector<vector<int>>& mat) {\n        \n        // length of 1D array\n        int n = nums.size();\n\n\n        // length of row & column in matrix\n        row_Size = mat.size();\n        col_Size = mat[0].size();\n        \n\n        // vectors for tracking row & column are filled or not\n        vector<int>rows(row_Size,0);\n        vector<int>columns(col_Size,0);\n        \n\n        // maps values with location in matrix\n        unordered_map<int,pair<int,int>>mp;\n        \n\n        for(int i=0;i<row_Size;i++){\n            for(int j=0;j<col_Size;j++){\n\n                int value = mat[i][j];         // value\n                pair<int,int>location = {i,j}; // location\n\n                mp[value] = location;          // mapping value with location\n\n            }\n        }\n        \n\n        for(int i=0;i<n;i++){\n            \n            int curr_Row = mp[nums[i]].first;  // getting current row\n            int curr_Col = mp[nums[i]].second; // getting current column\n            \n            rows[curr_Row]++;    // filling current row \n            columns[curr_Col]++; // filling current  column \n            \n            // return index if current row or column is filled\n            if(isFilled(rows,curr_Row,columns,curr_Col)) return i;     \n            \n        }\n        \n        // dummy index\n        return -1;\n        \n    }\n};\n```
['Array', 'Hash Table', 'Matrix', 'C++']