Checks if a given word is accepted by a NFA.

    The word w is accepted by a NFA if exists at least an
    accepting run on w.

    :param dict nfa: input NFA;
    :param list word: list of symbols ∈ nfa['alphabet'];
    :return: *(bool)*, True if the word is accepted, False otherwise.

def nfa_word_acceptance(nfa: dict, word: list) -> bool:
    """ Checks if a given word is accepted by a NFA.

    The word w is accepted by a NFA if exists at least an
    accepting run on w.

    :param dict nfa: input NFA;
    :param list word: list of symbols ∈ nfa['alphabet'];
    :return: *(bool)*, True if the word is accepted, False otherwise.
    """
    current_level = set()
    current_level = current_level.union(nfa['initial_states'])
    next_level = set()
    for action in word:
        for state in current_level:
            if (state, action) in nfa['transitions']:
                next_level.update(nfa['transitions'][state, action])
        if len(next_level) < 1:
            return False
        current_level = next_level
        next_level = set()

    if current_level.intersection(nfa['accepting_states']):
        return True
    else:
        return False