Fill in the grid with flags that meet the criteria of both the row and column corresponding to their cell.