Given a nested list of integers (a JSON-style array that may contain integers or other nested arrays to arbitrary depth), return a single flat array containing all integers in the order they appear when the input is traversed left-to-right. Implement the flattening recursively.
Input: A JSON-style nested array of integers, e.g. [1,[2,[3,4]],5].
Output: Return a flat array as [v1,v2,...] in left-to-right order.
Input: [1,[2,[3,4]],5]
Output: [1,2,3,4,5]
Explanation: Traverse depth-first: 1, then the nested [2,[3,4]] -> 2,3,4, then 5.Input: [[1,2],[3,4]]
Output: [1,2,3,4]
Explanation: Two sub-arrays concatenated.Input: [[[[1]]]]
Output: [1]
Explanation: Deeply nested single element.Total number of integers <= 10^4Maximum nesting depth <= 50-10^9 <= value <= 10^9