Skip to content

Commit f889885

Browse files
refactor 684
1 parent 81faf43 commit f889885

File tree

1 file changed

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

1 file changed

+0
-29
lines changed

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

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,6 @@
33
import java.util.HashSet;
44
import java.util.Set;
55

6-
/**
7-
* 684. Redundant Connection
8-
*
9-
* We are given a "tree" in the form of a 2D-array, with distinct values for each node.
10-
* In the given 2D-array, each element pair [u, v] represents that v is a child of u in the tree.
11-
* We can remove exactly one redundant pair in this "tree" to make the result a (rooted) tree.
12-
* You need to find and output such a pair. If there are multiple answers for this question, output the one appearing last in the 2D-array. There is always at least one answer.
13-
14-
Example 1:
15-
Input: [[1,2], [1,3], [2,3]]
16-
Output: [2,3]
17-
Explanation: Original tree will be like this:
18-
1
19-
/ \
20-
2 - 3
21-
22-
23-
Example 2:
24-
Input: [[1,2], [1,3], [3,1]]
25-
Output: [3,1]
26-
Explanation: Original tree will be like this:
27-
1
28-
/ \\
29-
2 3
30-
31-
Note:
32-
The size of the input 2D-array will be between 1 and 1000.
33-
Every integer represented in the 2D-array will be between 1 and 2000.
34-
*/
356
public class _684 {
367

378
public static class Solution1 {

0 commit comments

Comments
 (0)