Best solution 11
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    Solution(int m, int n) : rows(m), cols(n), total(m * n) {\n    }\n    vector<int> flip() {\n        if (used.size() == total) return {};\n        int index = rand() % total;\n        while (used.count(index))\n        index = ++index % total;\n        used.insert(index);\n        return {index / cols, index % cols};\n    }\n    void reset() {\n        used.clear();\n    }\n private:\n    unordered_set<int> used;\n    int rows;\n    int cols;\n    int total;\n};\n```
['C++']