
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.
arr = [1, [2, 3], 4]Output[1, 2, 3, 4]WhyExpand the inner list in place.arr = [1, [2, [3, 4], []], 5]Output[1, 2, 3, 4, 5]WhyRecursively flatten every nested list.`0 <= len(arr) <= 10^4`Total nested structure size is at most `10^5`Nesting depth is at most `10^3`Each element is either an integer or a list