def test_count_islands_2_islands(self): rows, cols, map, lands_cnt, coloring_map = self._map_2_islands() self.assertEqual(count_islands(rows, cols, map), lands_cnt)
def test_count_islands_invalid_shape(self): rows, cols, map, lands_cnt, coloring_map = self._map_invalid_shape() self.assertEqual(count_islands(rows, cols, map), -1)