Your question is Flatten Nested JSON Object Arrays. 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.
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.
0 <= total elements across nesting <= 10^5dict or a list