leetCode/src/main/java/com/leetcode/num/NumIslands.java

26 lines
593 B
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.leetcode.num;
/**
* 给你一个由 '1'(陆地)和 '0'(水)组成的的二维网格,请你计算网格中岛屿的数量。
岛屿总是被水包围,并且每座岛屿只能由水平方向和/或竖直方向上相邻的陆地连接形成。
此外,你可以假设该网格的四条边均被水包围。
来源力扣LeetCode
链接https://leetcode-cn.com/problems/number-of-islands
*/
public class NumIslands {
public int numIslands(char[][] grid) {
return 0;
}
public static void main(String[] args) {
}
}