from typing import Dict
from typing import List
from typing import Tuple


def get_cardinalities(candidates: Dict[str, List[str]]) -> List[Tuple[str, int]]:
    """
    Compute the size of candidate sets per-guess per-result.

    Args:
        candidates (Dict[str, List[str]]): mapping of result to candidate list per-guess

    Returns:
        List[Tuple[str, int]]: pairings of guess outputs and number of words
    """
    result: List[Tuple[str, int]] = []
    for candidate in candidates:
        result.append(
            (
                candidate,
                len(candidates[candidate]),
            )
        )
    result.sort(key=lambda t: t[1], reverse=True)
    return result