Your question is Flatten a Nested Array. 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 flat array of all non-array elements in left-to-right order. Elements can be nested to arbitrary depth, and empty arrays should not add anything to the result.
0 <= len(arr) <= 10^410^510^3