When ever you are answering such questions just try to find out the pattern:
0-->1-->0-->2-->0-->2--->(initial 0 i.e starting sate and then sequence repeats)
so the moment we see the decimal outputs till 2, we need atleast 2 bits for representing(0,1,2).
But now the catch is here 0 has non-determinism, to avoid such nondeterminism we need to add padding bits to
differentiate 3 0s.
Now one bit can differentiate only 2 0s. Hence 2 padding bits are needed to represent 3 0s.
3 0s now can be XX00,XX00,XX00. Such that the pair XX is unique for each 0; it can be any binary sequence.
1 can be reprsented as XX01, 2 as XX10.
So 4 Flipflops needed