Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8dd97d1

Browse files
refactor 364
1 parent91052c5 commit8dd97d1

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

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,6 @@
66
importjava.util.List;
77
importjava.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
publicclass_364 {
2410

2511
publicstaticclassSolution1 {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp