Input: nestedList = [[1,1],2,[1,1]] Output: 10 Explanation: Four 1's at depth 2, one 2 at depth 1. 11 + 11 + 22 + 11 + 1*1 = 10.
I suppose you meant 1 * 2 + 1 * 2 + 2 * 1 + 1 * 2 + 1 * 2 = 10.