Your question is Flatten Nested Array Structure. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Given a nested array arr, return a new flat array containing all non-array elements in left-to-right order. Elements may be nested to arbitrary depth, and empty nested arrays should contribute nothing to the result.
def flatten_array(arr):