Skip to content

Commit 8dd97d1

Browse files
refactor 364
1 parent 91052c5 commit 8dd97d1

File tree

1 file changed

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

1 file changed

+0
-14
lines changed

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

-14
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,6 @@
66
import java.util.List;
77
import java.util.Queue;
88

9-
/**
10-
* 364. Nested List Weight Sum II
11-
*
12-
* Given a nested list of integers, return the sum of all integers in the list weighted by their depth.
13-
14-
Each element is either an integer, or a list -- whose elements may also be integers or other lists.
15-
16-
Different from the previous question where weight is increasing from root to leaf, now the weight is defined from bottom up. i.e., the leaf level integers have weight 1, and the root level integers have the largest weight.
17-
18-
Example 1:
19-
Given the list [[1,1],2,[1,1]], return 8. (four 1's at depth 1, one 2 at depth 2)
20-
21-
Example 2:
22-
Given the list [1,[4,[6]]], return 17. (one 1 at depth 3, one 4 at depth 2, and one 6 at depth 1; 1*3 + 4*2 + 6*1 = 17)*/
239
public class _364 {
2410

2511
public static class Solution1 {

0 commit comments

Comments
 (0)