Flatten a nested list containing integers and sublists into a single list of integers in left-to-right order. The nesting can be arbitrarily deep, and empty lists may appear anywhere.
Constraints
Input length can be up to 10^4
Each element is either an integer or another nested list
Preserve left-to-right order
Nesting depth may be greater than 1
Interviewer
Your question is Flatten Nested Integer List. 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.