Problem 3619 · Medium

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.

Open the interactive visualisation