摘要: 1559. 二维网格图中探测环 class Solution { int[] dx={0,1,0,-1}; int[] dy={1,0,-1,0}; int n; int m; char[][] grid; boolean[][] vis; int startx; int starty; boole 阅读全文
posted @ 2024-10-08 04:53 风乐 阅读(8) 评论(0) 推荐(0) 编辑
摘要: 1020. 飞地的数量 class Solution { int[] dx={0,1,0,-1}; int[] dy={1,0,-1,0}; int n; int m; int[][] grid; boolean[][] vis; int res; public int numEnclaves(in 阅读全文
posted @ 2024-10-08 03:57 风乐 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 733. 图像渲染 class Solution { int[] dx={0,1,0,-1}; int[] dy={1,0,-1,0}; int n; int m; int[][] image; boolean[][] vis; int color; int sourceColor; public 阅读全文
posted @ 2024-10-08 03:45 风乐 阅读(2) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.cn/problems/pacific-atlantic-water-flow/description/ class Solution { List<List<Integer>> res = new ArrayList<>(); int[] dx={0,1,0,-1 阅读全文
posted @ 2024-10-08 03:34 风乐 阅读(4) 评论(0) 推荐(0) 编辑