import functools


def flat_map(l):
    """Transform a list of list in a list with all the elements of the nested lists

    >>> flat_map([[1, 2, 3], [4, 5]])
    [1, 2, 3, 4, 5]
    """
    l = list(l)
    return functools.reduce(list.__add__, l) if l else []