Hello, I’m trying to implement the Nondeterministic finite automaton algorithm. Given a dictionary, start state, and list of inputs, I input the first input value into the start state. According to the dictionary ‘ndfa’ I receive a set of new states (ndfa[state][_input] -> {n_states}). I then move onto the next input value from the inputs […]

- Tags '1': {'start'}}, '1'] def process(ndfa : {str:{str:{str}}}, 'end': {}} state = 'start' inputs = ['1', 'hello', 'near': {'1': {'end'}}, 'start'] Input = 1; new possible states = ['end', 'start'] Input = 1; new possible states = ['start'] Input = 0; new possible states = ['near', 'start'] Stop state(s) = ['end', 'start'})] Visual of Algorithm: Start state = start Input = 1; new possible states = ['start'] Input = 0; new possible states = [', $near, 0, 1, and list of inputs, end=''), I input the first input value into the start state. According to the dictionary 'ndfa' I receive a set of new states (ndfa[state][_input] ->, I'm trying to implement the Nondeterministic finite automaton algorithm. Given a dictionary, inputs : [str]) -> [None]: process_list = [state] new_possible_states = {state} for _input in inputs: for _state in new_, inputs)) Correct Output of process_list: ['start', just ignore it. But if the input leads to no possible states (the empty set of states) terminate processing. This is what I'm trying right n, ndfa[_state][_input])) new_possible_states = ndfa[_state][_input] return process_list if __name__ == '__main__': print(process(ndfa, start, start state, State, state : str