A Convex function may receive a list containing values and other lists. Write a function that flattens the structure into a single list while preserving the left-to-right order of every value.
Implement flatten_nested(values), where values is a list whose elements are either integers or nested lists with the same structure. Return a new list containing all integers in depth-first, left-to-right order. Empty lists contribute no values.
Do not mutate the input list. The nesting depth is valid for Python's recursion limit.
def flatten_nested(values):