Skip to content

Commit 81f113f

Browse files
refactor 1361
1 parent d1016cd commit 81f113f

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

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

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,6 @@
55
import java.util.List;
66
import java.util.Map;
77

8-
/**
9-
* 1361. Validate Binary Tree Nodes
10-
*
11-
* You have n binary tree nodes numbered from 0 to n - 1 where node i has two children leftChild[i] and rightChild[i],
12-
* return true if and only if all the given nodes form exactly one valid binary tree.
13-
* If node i has no left child then leftChild[i] will equal -1, similarly for the right child.
14-
* Note that the nodes have no values and that we only use the node numbers in this problem.
15-
*
16-
* Example 1:
17-
* Input: n = 4, leftChild = [1,-1,3,-1], rightChild = [2,-1,-1,-1]
18-
* Output: true
19-
*
20-
* Example 2:
21-
* Input: n = 4, leftChild = [1,-1,3,-1], rightChild = [2,3,-1,-1]
22-
* Output: false
23-
*
24-
* Example 3:
25-
* Input: n = 2, leftChild = [1,0], rightChild = [-1,-1]
26-
* Output: false
27-
*
28-
* Example 4:
29-
* Input: n = 6, leftChild = [1,-1,-1,4,-1,-1], rightChild = [2,-1,-1,5,-1,-1]
30-
* Output: false
31-
*
32-
* Constraints:
33-
* 1 <= n <= 10^4
34-
* leftChild.length == rightChild.length == n
35-
* -1 <= leftChild[i], rightChild[i] <= n - 1
36-
* */
378
public class _1361 {
389
public static class Solution1 {
3910
public boolean validateBinaryTreeNodes(int n, int[] leftChild, int[] rightChild) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy