Flatten and rebuild nested Python containers
Given an arbitrarily nested mix of lists, tuples and dicts with integer leaves, produce a flat list of the integers in order. Then, given the original structure and a new flat list, rebuild a structure of the same shape filled with the new values.
No answer yet. Write the first one; the best answer gets endorsed.
