from typing import Dict
from typing import List


def transform(legacy_data: Dict[int, List[str]]) -> Dict[str, int]:
    """
    Take Scrabble scores stored in a legacy format and return it in the new format
    """
    # Initialise what we're going to return
    new_score_map = {}

    # Iterating over dict.items() returns a (key, value) tuple, which we can unpack
    for score, letter_list in legacy_data.items():
        for letter in letter_list:
            new_score_map[letter.lower()] = score

    return new_score_map