Flatten a deeply nested array whose elements are either JSON objects (dict) or more arrays. Return all objects in left-to-right order without using recursion.
Constraints
0 <= total elements across nesting <= 10^5
Each element is either a dict or a list
Nesting depth can be very large
Interviewer
Your question is Flatten Nested JSON Object Arrays. Start with the requirements in the Question tab.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.