from typing import List


def convert_sample_names_to_indices(
    names: List[str], samples: List[str]
) -> List[int]:
    """Maps samples to their integer indices in a given set of names.

    Used to map sample string names to the their integer positions in the index
    of the original character matrix for efficient indexing operations.

    Args:
        names: A list of sample names, represented by their string names in the
            original character matrix
        samples: A list of sample names representing the subset to be mapped to
            integer indices

    Returns:
        A list of samples mapped to integer indices
    """
    name_to_index = dict(zip(names, range(len(names))))

    return list(map(lambda x: name_to_index[x], samples))