flattening-arrays

The code solves the problem of flattening arrays.

For example if we have an array like the following [[1, 2], [3, 4, 5], [6, 7, 8, 9]] it should returns [1, 2, 3, 4, 5, 6, 7, 8, 9]

Another examples:
[[[1, [2]], [3, 4, 5]], [6, [7, [8]], 9]]
[[1, [2, [[3]]]], 4, [5, [[[6]]]]]