Given a nested list nestedList of NestedInteger elements, compute the weighted sum of all integers contained in it.
Each integer contributes its value multiplied by its depth, where the depth of an integer is the number of lists from the outermost list down to the integer. The outermost level has depth
Return the total weighted sum.
Constraints:
nestedList.length
Each integer value in nestedList is in the range
The maximum depth of any integer is
Given a nested list nestedList of NestedInteger elements, compute the weighted sum of all integers contained in it.
Each integer contributes its value multiplied by its depth, where the depth of an integer is the number of lists from the outermost list down to the integer. The outermost level has depth
Return the total weighted sum.
Constraints:
nestedList.length
Each integer value in nestedList is in the range
The maximum depth of any integer is