← Code LabPython0/50 solved · 0%
Collections · medium

37. itertools and reduce

Functional-style aggregation helpers.

Write `total_and_flatten(nested)` returning a tuple `(total, flat_list)` where `flat_list` is `nested` flattened one level using `itertools.chain`, and `total` is the sum via `functools.reduce`.
Required in your answer: chain(reduce(