Nested List Weight Sum II
Input:
[[1,1],2,[1,1]]
Output:
8
Explanation:
F
our 1's at depth 1, one 2 at depth 2.Input:
[1,[4,[6]]]
Output:
17
Explanation:
O
ne 1 at depth 3, one 4 at depth 2, and one 6 at depth 1; 1*3 + 4*2 + 6*1 = 17.Last updated