542. 01 矩阵
问题描述:
代码:
class Solution {
int d[][]={{0,1},{1,0},{-1,0},{0,-1}};
public int[][] updateMatrix(int[][] mat) {
Queue queue = new linkedList();
int n=mat.length,m=mat[0].length;
Boolean isZero[][]=new Boolean[n][m];
int dist[][]=new int[n][m];
for(int i=0;i=0 && xx=0 && yy
思路:
994. 腐烂的橘子
问题描述:
代码:
class Solution {
static int dir[][]={{0,1},{1,0},{-1,0},{0,-1}};
public int orangesRotting(int[][] grid) {
int n=grid.length,m=grid[0].length;
Queue queue = new linkedList();
for(int i=0;i=0 && dx=0 && dy
思路:



