Python Medium
\nclass Solution:\n\n    def __init__(self, m: int, n: int):\n        self.M, self.N = m, n\n        self.ones = set()\n        \n\n    def flip(self) -> List[i
```\nclass Solution:\n\n    def __init__(self, m: int, n: int):\n        self.M, self.N = m, n\n        self.ones = set()\n        \n\n    def flip(self) -> List[int]:\n        while True:\n            i = random.randint(0, self.M - 1)\n            j = random.randint(0, self.N - 1)\n            if (i, j) not in self.ones:\n                self.ones.add((i, j))\n                return (i, j)\n\n\n        \n\n    def reset(self) -> None:\n        self.ones = set()\n\n\n\n# Your Solution object will be instantiated and called as such:\n# obj = Solution(m, n)\n# param_1 = obj.flip()\n# obj.reset()\n```
['Python3']