Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Recursion + nonlocal solution in Clear category for Flatten a List by evarome10
def flat_list(array):
result = []
def recurs(array):
nonlocal result
for i in array:
if isinstance(i, int):
result.append(i)
else:
recurs(i)
recurs(array)
return result
Nov. 16, 2018
Comments: