519. Random Flip Matrix.cpp
Code\n\nclass Solution {\npublic:\n   set<pair<int,int>> s;\n    int r , c; \n    Solution(int m, int n) \n    {        \n        r = m ; \n        c = n ; \n  
**Code**\n```\nclass Solution {\npublic:\n   set<pair<int,int>> s;\n    int r , c; \n    Solution(int m, int n) \n    {        \n        r = m ; \n        c = n ; \n    }    \n    vector<int> flip() \n    {\n        int x = rand()%r; \n        int y = rand()%c; \n        if(s.find({x,y})==s.end())\n        {    s.insert({x,y});\n            return {x,y};\n        }\n        else return flip();\n    }    \n    void reset() \n    {\n         s.clear(); \n    }\n};\n```
['C']