O(1) S.C O(1) T.C For every Function Call || Without Use of Random Function ⭐⭐||
Intuition\n1. You have only give output in call of flip() . The output will be a vector having indices {i,j}\n2. Now you have to give indices suc that never a i
# Intuition\n1. You have only give output in call of flip() . The output will be a vector having indices {i,j}\n2. Now you have to give indices suc that never a index repeates  before reset call And We know that filp will not be called more than n*m times before reset call.Beacuse that mill make a index flip twice which is not possible.\n3. Using this we will give indexes sequentially like {0,0} ,{0,1}, {0,2}..{1,0},..,{n-1,m-1}.\n4. We will not need reset call as there any index will not repeat \n\n# Approach\n1. Just start from 0,0 in flip . \n2. Increment j every time\n3. IF j equals last column index then go to next row and start from begining of column ==> i++; j=0;\n4. If i equals last row index then go to first row ==> i=0;\n5. Every time return index i.e {i,j}\n\n# Complexity\n- Time complexity:\n $$O(1)$$\n\n- Space complexity:\n$$O(1)$$ \n\n# Code\n```\nclass Solution {\npublic:\n    int n,m,i=0,j=0;\n    Solution(int m, int n) {\n        this->n=m; this->m=n;\n    }\n    vector<int> flip() {\n        if(j>=m) { // If j== m then i++ means next row from starting.\n            j=0; i++;\n        }\n        j++;\n        if(i>=n) i=0;  // Bringing i within bounds\n        return {i,j-1};\n    }\n    void reset() {// We Will never need this}\n};\n```
['C++']