Simple C++ Solution - Easy to Understand - HashMap solution
\nclass Solution {\npublic:\n    \n    map<pair<int,int>,int> temp;\n    int row;\n    int col;\n    Solution(int n_rows, int n_cols) {\n        row=n_rows;\n  
```\nclass Solution {\npublic:\n    \n    map<pair<int,int>,int> temp;\n    int row;\n    int col;\n    Solution(int n_rows, int n_cols) {\n        row=n_rows;\n        col=n_cols;\n    }\n    \n    vector<int> flip() {\n        int total=row*col;\n        int ok=rand()%total;\n        int r=ok/col;\n        int c=ok%col;\n        pair<int,int> temp1={r,c};\n        while(temp[temp1]!=0){\n            ok=rand()%total;\n            r=ok/col;\n            c=ok%col;\n            temp1={r,c};\n        }\n        temp[temp1]=1;\n        vector<int> ans={r,c};\n        return ans;\n    }\n    \n    void reset() {\n        temp.clear();\n    }\n};\n\n/**\n * Your Solution object will be instantiated and called as such:\n * Solution* obj = new Solution(n_rows, n_cols);\n * vector<int> param_1 = obj->flip();\n * obj->reset();\n */\n```
['C', 'C++']