from typing import Dict
from typing import List


def counts_to_dist(counts: Dict[str, int]) -> List[int]:
    """Converts counts to a distribution

    :param counts: a Qiskit-style counts dictionary
    :return: a probability distribution
    """
    num_qubits = len(list(counts.keys())[0].replace(' ', ''))
    counts_list = [0] * 2 ** num_qubits
    for state in counts:
        f_state = state.replace(' ', '')
        counts_list[int(f_state, 2)] = counts[state]
    dist = [element / sum(counts_list) for element in counts_list]
    return dist