Skip to content

Commit 6cdd9af

Browse files
refactor 994
1 parent 5c8684d commit 6cdd9af

File tree

1 file changed

+0
-32
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+0
-32
lines changed

src/main/java/com/fishercoder/solutions/_994.java

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,6 @@
33
import java.util.LinkedList;
44
import java.util.Queue;
55

6-
/**
7-
* 994. Rotting Oranges
8-
*
9-
* In a given grid, each cell can have one of three values:
10-
*
11-
* the value 0 representing an empty cell;
12-
* the value 1 representing a fresh orange;
13-
* the value 2 representing a rotten orange.
14-
* Every minute, any fresh orange that is adjacent (4-directionally) to a
15-
* rotten orange becomes rotten.
16-
* Return the minimum number of minutes that must elapse until no cell has a fresh orange.
17-
* If this is impossible, return -1 instead.
18-
*
19-
* Example 1:
20-
* Input: [[2,1,1],[1,1,0],[0,1,1]]
21-
* Output: 4
22-
*
23-
* Example 2:
24-
* Input: [[2,1,1],[0,1,1],[1,0,1]]
25-
* Output: -1
26-
* Explanation: The orange in the bottom left corner (row 2, column 0) is never rotten, because rotting only happens 4-directionally.
27-
*
28-
* Example 3:
29-
* Input: [[0,2]]
30-
* Output: 0
31-
* Explanation: Since there are already no fresh oranges at minute 0, the answer is just 0.
32-
*
33-
* Note:
34-
* 1 <= grid.length <= 10
35-
* 1 <= grid[0].length <= 10
36-
* grid[i][j] is only 0, 1, or 2.
37-
*/
386
public class _994 {
397
public static class Solution1 {
408
int[] directions = new int[]{0, 1, 0, -1, 0};

0 commit comments

Comments
 (0)