LeetCode
Random Flip Matrix
Click
here
for an explanation.