摘要:
https://leetcode.cn/problems/island-perimeter/description/ 思路:遍历岛屿,一旦遍历到边界或者水则周长++ class Solution { int res; boolean[][] vis; int[][] grid; int[] dx=n 阅读全文
摘要:
https://leetcode.cn/problems/surrounded-regions/ class Solution { int n; int m; boolean[][] vis; char[][] board; int[] dx=new int[]{0,1,0,-1}; int[] d 阅读全文
摘要:
https://leetcode.cn/problems/number-of-operations-to-make-network-connected/ 并查集模版题 class Solution { public int makeConnected(int n, int[][] connectio 阅读全文