Solved percolation problem described in Percolation assignment.