From f1eae5140a7b4e8c2330ac4ed99d368ec5e8ccae Mon Sep 17 00:00:00 2001 From: Volodymyr Baliasnikov Date: Thu, 1 Oct 2026 20:38:13 +0200 Subject: [PATCH] u3 --- u3/flatten_array.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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