The first question was https://leetcode.com/problems/nested-list-weight-sum/
the second question was a follow up and it was to reverse the depth.
If the input was [1,[4,[6]]]
6 * 1
4 * 2
1 * 3
ans = 17
Comments (5)
The first question was https://leetcode.com/problems/nested-list-weight-sum/
the second question was a follow up and it was to reverse the depth.
If the input was [1,[4,[6]]]
6 * 1
4 * 2
1 * 3
ans = 17