input: [1, 2, [2, [5, 3, 4]] ] output: [1,2, 3, 5, 3, 4] the output order does not matter, just so long as the array is flattened