Python solution beats 100% which uses 1 time random for each call
\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 = n
```\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 = n_rows * n_cols\n        self.n_cols = n_cols\n        self.reset()\n\n    def flip(self):\n        """\n        :rtype: List[int]\n        """\n        index = int(random.random() * (self.n - len(self.removed)))\n        alreadySkipped = 0\n        while True:\n            removedBefore = bisect.bisect(self.removed, index)\n            if removedBefore == alreadySkipped:\n                break\n            index += removedBefore - alreadySkipped\n            alreadySkipped = removedBefore\n        bisect.insort(self.removed, index)\n        # del self.indexes[i]\n        return (index // self.n_cols, index % self.n_cols)\n\n    def reset(self):\n        """\n        :rtype: void\n        """\n        # self.indexes = list(range(self.n))\n        self.removed = []\n\n\n# Your Solution object will be instantiated and called as such:\n# obj = Solution(n_rows, n_cols)\n# param_1 = obj.flip()\n# obj.reset()\n```
[]