LeetCode 519: Random Flip Matrix
Problem Restatement We are given a binary matrix with: m rows n columns Initially, every cell contains: 0 We need to design a data structure supporting two operations. Operations flip() Randomly choose one remaining cell containing 0 . Change it to: 1 Return its coordinates. Every remaining zero cell must have equal probability of being chosen. reset() Set all cells back to: 0 The official problem asks us to randomly...