HTT

state 0 : initial state

state 1 : H

state 2 : HT

state 3 : HTT (final state)

Initially you're in state 0. You will remain in state 0 until you flip a H (in which case you'll move to state 1).

Once in state 1, you will remain there until you flip a T (in which case you'll will move to state 2).

And once in step 2, you'll move to state 3 if you flip a T, and move back to state 1 if you flip a H.

Now let be the expected amount of flips in takes to reach state 3 starting from state i.

You can set up three equations by conditioning on your first flip after you enter a state.

now solve for

I get 8 flips.