Any non-empty string winds up in Q2 and stays there, so you match more than you should. For example, $bbb$ is accepted even though it's not in $L$.
The initial state should keep reading input until $a$ is read, and the other one should be the accepting state and just consume the rest of the input by looping any input to itself.
Any non-empty string winds up in Q2 and stays there, so you match more than you should. For example, $bbb$ is accepted even though it's not in $L$.
The initial state should keep reading input until $a$ is read, and the other one should be the accepting state and just consume the rest of the input by looping any input to itself.