Python solution with store one number each time
\nclass Solution:\n\n    def __init__(self, n_rows, n_cols):\n        """\n        :type n_rows: int\n        :type n_cols: int\n        """\n        self.n, se
```\nclass Solution:\n\n    def __init__(self, n_rows, n_cols):\n        """\n        :type n_rows: int\n        :type n_cols: int\n        """\n        self.n, self.m = n_rows, n_cols\n        self.total = self.n * self.m - 1\t\t\t\t\n        self.reset()\n\n    def flip(self):\n        """\n        :rtype: List[int]\n        """\n        res = random.randint(0, self.total)\n        while res in self.used:\n            res = random.randint(0, self.total)\n        self.used.add(res)\n        return [res//self.m, res%self.m]\n\n    def reset(self):\n        """\n        :rtype: void\n        """\n        self.used = set()\n```
[]