from typing import Iterable


def _get_common_letters(box_id1: str, box_id2: str) -> str:
    """Returns common letters in the box ids
    Arguments:
        box_id1 {String}
        box_id2 {String}
    Returns:
        [String]
    """
    # I can iterate through both the string and find out the diff in one iteration only.
    # below logic is O(n), n - min(length(boxid1), length(boxid2))
    common_letters: Iterable[str] = map(
        lambda e: e[0] if e[0] == e[1] else "", zip(box_id1, box_id2)
    )
    return "".join(common_letters)