First we will solve it using Recursion.
Let’s say E[n] = Expected number of HH in n consecutive tosses.
Say X[i] = Output ( H/T ) on the ith toss.
If first toss returns T, then expected number of HH in 10 tosses is same as expected number of HH inthe next 9 tosses.
E[10 | X[1] = T] = E[9].
If first toss returns H, then expected number of HH in 10 tosses is (1+E[9]) if 2nd toss returns H, and E[9] if 2nd toss returns T.