Originally Posted by
Adak
In the
1 0
0 1 matrix, the count is 2 because you have two 1's that have no path to other cells, right?
And in this matrix:
1 1
0 0
the count is 1 because it has no path to the last row.
If the matrix were:
1 1
0 0
0 0
then would the count be 2 (meaning we're counting the number of rows with no path to them), or would it be one, because we're counting the link(s) between two cells.
What would these counts be?
1 1
0 1
0 1
1 1
0 0
1 1
As we loop (iterate) through the loop, what *exactly* triggers a count increase? That's all we need to know. Your prior description was more of a pronouncement. "Count is N!" :(
If you can "nail down" the description, of just exactly what we're counting, the problem will be solved in a jiffy. Then it's a trivial problem to code up.