✅Easy C++ Solution || Goldman Sachs || HashMap || Pairs || Randomized
Code\n\n#include<bits/stdc++.h>\nclass Solution {\n    int m, n;\n    map<pair<int, int>, int> mp;\npublic:\n    Solution(int m, int n) {\n        this -> m = m
# Code\n```\n#include<bits/stdc++.h>\nclass Solution {\n    int m, n;\n    map<pair<int, int>, int> mp;\npublic:\n    Solution(int m, int n) {\n        this -> m = m;\n        this -> n = n;\n    }\n    \n    vector<int> flip() {\n        int a = rand() % m;\n        int b = rand() % n;\n\n        while(mp[{a,b}]>0)\n        {\n            a = rand() % m;\n            b = rand() % n;\n        }\n\n        mp[{a, b}]++;\n        return {a, b};\n    }\n    \n    void reset() {\n        mp.clear();\n    }\n};\n\n/**\n * Your Solution object will be instantiated and called as such:\n * Solution* obj = new Solution(m, n);\n * vector<int> param_1 = obj->flip();\n * obj->reset();\n */\n```
['Hash Table', 'Math', 'Reservoir Sampling', 'Randomized', 'C++']