leetcode994】的更多相关文章

In a given grid, each cell can have one of three values: the value 0 representing an empty cell; the value 1 representing a fresh orange; the value 2 representing a rotten orange. Every minute, any fresh orange that is adjacent (4-directionally) to a…
public class Solution { ; ; ; ; ; Queue<int[]> Q = new Queue<int[]>(); int[,] TagGrid; public void BFS(int[][] grid) { var rottinglist = new List<int[]>(); ) { ) { var orange = Q.Dequeue(); ]; ]; ; ; //合法范围:up,down,left,right //未访问的:TagG…