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
Whenever you're ready, walk me through your approach or go straight to the code. The requirements are in the Question tab.