Facebook | Phone | Nested List Weight Sum
Anonymous User
3593

Position: Summer SWE Intern

Question:
https://leetcode.com/problems/nested-list-weight-sum/ (premium)

Input: [8, 4, [5, [9], 3], 6]
Output: 8+4+2*(5+3*(9) + 3)+6 ==> 88

Add every element in each list and multiply them by the depth of the list.

Language: Java

Comments (7)