diff --git a/u3/flatten_array.py b/u3/flatten_array.py index e69de29..538a88d 100644 --- a/u3/flatten_array.py +++ b/u3/flatten_array.py @@ -0,0 +1,15 @@ +def flatten(iterable): + result = [] + copy = list(iterable) + + while copy: + + item = copy.pop(0) + + if isinstance(item,list): + copy = item + copy + + elif item is not None: + result.append(item) + + return result \ No newline at end of file