store flipped bits in set
\nfrom random import randint\n\nclass Solution:\n\n    def __init__(self, m: int, n: int):\n        self.m = m\n        self.n = n\n        self.ones = set()\n\
```\nfrom random import randint\n\nclass Solution:\n\n    def __init__(self, m: int, n: int):\n        self.m = m\n        self.n = n\n        self.ones = set()\n\n    def flip(self) -> List[int]:\n        i, j = randint(0, self.m - 1), randint(0, self.n - 1)\n        while (i, j) in self.ones:\n            i, j = randint(0, self.m - 1), randint(0, self.n - 1)\n        self.ones.add((i, j))\n        return [i, j]\n\n    def reset(self) -> None:\n        self.ones.clear()\n```
['Python']