Implement solve(arr) that takes a nested array of arbitrary depth and
returns a brand-new, fully flattened, single-level array.
Examples
solve([1, [2, [3, [4]]]]) → [1, 2, 3, 4]solve([]) → []solve([[1, 2], [3, 4]]) → [1, 2, 3, 4]Constraints
O(n) solution where n is the total element count.Sample tests