Write a function that takes an array [1, 2, [3, 4, [5], 6], 7]
and returns the sum of all elements where each element is multiplied by its depth.
In this example:
(1 * 1) + (2 * 1) + (3 * 2) + (4 * 2) + (5 * 3) + (6 * 2) + (7 * 1) = 51
hint: recursion makes this simpler to implement
sample input: