← 返回 meta 的题目列表Nested List Weight Sum
类型:online_judge
Given a nested list of integers, return the weighted sum. Each integer is multiplied by its depth, starting with depth 1. For example, given the list [1,[4,[6]]], 1 is at depth 1, 4 is at depth 2, and 6 is at depth 3. The result should be 11 + 42 + 6*3 = 27.
Example
Input
([1,[4,[6]]])