From 9c737114447c67070bb8b09475a4d6123117fd63 Mon Sep 17 00:00:00 2001 From: Maksym Kurets Date: Wed, 30 Sep 2026 23:51:02 +0200 Subject: [PATCH] Add flatten_array solution for U3 --- u3/flatten_array.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 u3/flatten_array.py diff --git a/u3/flatten_array.py b/u3/flatten_array.py new file mode 100644 index 0000000..b528dd7 --- /dev/null +++ b/u3/flatten_array.py @@ -0,0 +1,10 @@ +def flatten(iterable): + pusti = [] + for gns in iterable: + if gns is None: + continue + elif isinstance(gns, (list, tuple)): + pusti.extend(flatten(gns)) + else: + pusti.append(gns) + return pusti