The game would finish as soon as we get two consecutive heads or tails/
If after getting a head we get a tail, we are one step away from finishing the game. So we move to that state, in the downward direction.
We can extend this logic to the time when we get one tail and after that, we get a head.