Hello,

I've taken a look at the midterm and I can't understand the solution of the 4th question.

It's written that the language can be computed by a DFA with 6 states.

As I see it, there's a need of a stack to compute this language.

For example, the word 111110000000000000.

States that describe only {-2,-1,0,1,2} are not sufficient in this case.

Can someone please help me figure out what am I missing?

Thanks and Shabat Shalom!