TS hash-map solution
Approach
Generate map for rows with flipped columns set
On flip: generate row until find row with 0 values, then generate column
Code
# Approach
1. Generate *map* for *rows* with flipped columns *set*
2. On flip: generate *row* until find row with 0 values, then generate *column*

# Code
```typescript []
class Solution {
    private checkedMap = new Map<number, Set<number>>();
    private m = 0;
    private n = 0;

    constructor(m: number, n: number) {
        this.m = m;
        this.n = n;
    }

    flip(): number[] {
        // Get row index to generate col
        let row = Math.ceil(Math.random() * this.m - 1);
        let checked = this.checkedMap.get(row) ?? new Set();
        while(checked.size === this.n) {
            row = Math.ceil(Math.random() * this.m - 1);
            checked = this.checkedMap.get(row) ?? new Set();
        }

        // Get column index
        let col = Math.ceil(Math.random() * this.n - 1);
        while(checked.has(col)) {
            col = Math.ceil(Math.random() * this.n - 1);
        }
        
        checked.add(col);
        this.checkedMap.set(row, checked);

        return [row, col];
    }

    reset(): void {
        this.checkedMap.clear();
    }
}

/**
 * Your Solution object will be instantiated and called as such:
 * var obj = new Solution(m, n)
 * var param_1 = obj.flip()
 * obj.reset()
 */
```
['TypeScript']