from typing import List
from typing import Dict
from typing import Any


def list_dict_flip(ld: List[Dict[str, Any]]) -> Dict[str, List[Any]]:
    """
    Utility that returns a dictionnary of list of dictionnary into a dictionary of list

    Arguments:
        - ld: list of dictionaary
    Returns:
        - flipped: dictionnary of lists
    Example:
        - ld = [{"a":1, "b":2}, {"a":3, "b":4}]
        - flipped = {'a': [1, 3], 'b': [2, 4]}
    """
    flipped = dict((k, []) for (k, v) in ld[0].items())
    for rs in ld:
        for k in flipped.keys():
            flipped[k].append(rs[k])
    return flipped