from typing import List


def extract_components(sizes: List[int], n: int) -> List[int]:
    """Given a list of dimension sizes, and an integer less than the product of
    the sizes, this function will extract the component value for each
    dimension from the total.

    For example, if ``sizes`` is ``[3, 4, 2]``, there are 24 possible
    combinations of the three. If ``0 <= n < 24``, this function will return
    the selections for each dimension for that ``n``.
    """
    components = []
    for s in sizes:
        components.append(n % s)
        n //= s

    return components