Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Recursion with 2 terminate conditions solution in Clear category for Flatten a List by martin.pilka
def flat_list(array):
if array == []:
return []
elif type(array) == int:
return [array]
else:
return flat_list(array[0]) + flat_list(array[1:])
Feb. 2, 2019