Count Islands With Total Value Divisible by K

Solution Code

Time Complexity

O(mn)

Space Complexity

O(mn)