Python solution with constant call times with flips function
The idea is that calling random shuffle once when initiating to get a shuffled sequence of [0,n_rows) and [0,n_cols), then use the pointer when calling flip met
The idea is that calling random shuffle once when initiating to get a shuffled sequence of [0,n_rows) and [0,n_cols), then use the pointer when calling flip method.  When calling reset, just reset the point back to 0 and randomly pick a index larger than 0 and replace with the number in index 0.\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.rows = [x for x in range(n_rows)]\n        \n        \n        self.cols = [x for x in range(n_cols)]\n        random.shuffle(self.rows)\n        random.shuffle(self.cols)\n        self.i = 0\n\n    def flip(self):\n        """\n        :rtype: List[int]\n        """\n        \n        value = [self.rows[self.i//len(self.cols)],self.cols[self.i%len(self.cols)]]\n        self.i+=1\n        return value\n        \n\n    def reset(self):\n        """\n        :rtype: void\n        """\n        self.i = 0\n        if len(self.rows)>1:\n            idx = random.randint(1,len(self.rows)-1)\n            self.rows[0],self.rows[idx] = self.rows[idx],self.rows[0]\n        if len(self.cols)>1:\n            idx = random.randint(1,len(self.cols)-1)\n            self.cols[0],self.cols[idx] = self.cols[idx],self.cols[0]       \n```\n
[]