This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def flatten(array): | |
""" | |
Drop in an array of a arrays (ex: [[1,2,[3]],4]) and get back a flattened array (ex: [1,2,3,4]). | |
""" | |
new_array = [] | |
for i in array: | |
if not isinstance(i, list): | |
new_array.append(i) | |
else: |