Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit d2f502c

Browse files
refactor 1315
1 parent b0fba81 commit d2f502c

File tree

1 file changed

+0
-24
lines changed

1 file changed

+0
-24
lines changed

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

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,6 @@
22

33
import com.fishercoder.common.classes.TreeNode;
44

5-
/**
6-
* 1315. Sum of Nodes with Even-Valued Grandparent
7-
*
8-
* Given a binary tree, return the sum of values of nodes with even-valued grandparent.
9-
* (A grandparent of a node is the parent of its parent, if it exists.)
10-
* If there are no nodes with an even-valued grandparent, return 0.
11-
*
12-
* Example 1:
13-
* 6
14-
* / \
15-
* 7 8
16-
* / \ / \
17-
* 2 7 1 3
18-
* / / \ \
19-
* 9 1 4 5
20-
*
21-
* Input: root = [6,7,8,2,7,1,3,9,null,1,4,null,null,null,5]
22-
* Output: 18
23-
* Explanation: The red nodes are the nodes with even-value grandparent while the blue nodes are the even-value grandparents.
24-
*
25-
* Constraints:
26-
* The number of nodes in the tree is between 1 and 10^4.
27-
* The value of nodes is between 1 and 100.
28-
* */
295
public class _1315 {
306
public static class Solution1 {
317
public int sumEvenGrandparent(TreeNode root) {

0 commit comments

Comments
 (0)