Algorithm · Point72 · Easy
You are handed a string input that is built solely from the characters 'a' and 'b'. Your job is to run the deterministic finite automaton (DFA) pictured below over that string, feeding in one character at a time from left to right. The machine begins in state 1, and state 3 is the sole accepting state. Treat the diagram as a visual aid only; the transition table is what precisely pins down the automaton's behavior. Current State 'a' 'b' 1 1 2 2 2 3 3 3 1 After the whole…
Checking your access…