Count Islands With Total Value Divisible by K
Flood-fill each island of non-zero cells, add up its values, and count the islands whose total is divisible by k.
Flood-fill each island of non-zero cells, add up its values, and count the islands whose total is divisible by k.