Remove the mark-and-flip algorithm to be flip-immeidately once detected algorithm. Still O(n^2) but only needs to traverse the board once. It is still too slow to pass the large data set.