Expected number of coin flips until observing $n$ of the same side 
Question: Consider a coin which is flipped Heads with probability $p$ and Tails with probability $1-p$. Let $C_n$ be the number of tosses until we observe $n$ consecutive Heads or $n$ consecutive Tails (for the first time). Compute $\mathbb{E}[C_n]$.

I am able to determine the expected number of tosses until $n$ consecutive Heads with such a coin. But this relied conditional probability; namely, it involved conditioning upon the number of flips until the first Tail. 
For this reason, I can't figure out how to modify my technique when I allow both Heads & Tails to satisfy the $n$-consecutive-flip property. 
Also, this was from an old exam, so if there is a way to do this problem with reasonable time-constraints that would be great. Thank you
EDIT: Here's work for $H_n$ the number of tosses until we observe $n$ consecutive Heads.
Let $\mu = E[H_n]$ and $F$ denote the first instance of Tails. Then, 
$$
\mu = \sum_{k=1}^\infty E[H_n \mid F=k] P(F=k) = \sum_{k=1}^n (\mu+k) P(F=k) + \sum_{k=n+1}^\infty n P(F=k)
$$
where the first term on the RHS indicates that the first Tails was $\le n$, so we "start over" with $\mu$, and the second term indicates that the first $n$ flips were heads. Also note $\sum_{k=n+1}^\infty P(F=k)$ is the probability that the first $n$ flips were heads, so this equals $p^n$.
So $\mu \left( 1 - \sum_{k=1}^n P(F=k) \right) = n p^n + \sum_{k=1}^n k P(F=k) \implies \mu = p^n + \frac{1}{p^n} \sum_{k=1}^n k P(F=k).$
Finally, $\sum_{k=1}^n k P(F=k) = \sum_{k=1}^n k (1-p)p^{k-1} = \cdots = \dfrac{-n p^{n + 1} + (n + 1) p^n - 1 }{p - 1}$ after manipulating geometric series. Then, substituting into the formula above gives $\mu = \dfrac{p^{-n}(p^n-1)}{p-1}$.
 A: Let $H=1$ iffwe get $n$ consecutive heads before $n$ consecutive tails and $0$ otherwise. We can calculate $A_n=\mathbb{E}[C_n|H=1]$ by conditioning on the flip on which the process of collecting $n$ heads is interrupted by a tail. In other words, if we are interrupted on our first flip, the expected value is now $1+A_n$, if we are interrupted on our second flip, the expected value is now $2+A_n$, if..., if we are interrupted in our $n+1$th flip, the expected value is now $n$. Putting this all together, we get 
$$\begin{align} A_n&=\sum_{k=0}^{n-1}p^k(1-p)(k+1+A_n)\\ &=\sum_{k=0}^{n-1}p^k(1-p)(k+1)+\sum_{k=0}^{n-1}p^k(1-p)A_n \\ &=\frac{p^{-n}-1}{1-p} \end{align}$$
We can do the same for $B_n=\mathbb{E}[C_n|H=0]$, except that the probabilities will be reversed. Thus we obtain $$B_n=\frac{(1-p)^{-n}-1}{p}$$
To compute $\mathbb{P}(H=1)$ we condition on whether the first flip is a head. Here, we have two possibilities, either the following $n-1$ flips are heads, or one of these $n-1$ flips results in tails, at which point we forget about all previous heads and imagine that our first flip is a tail, thus
$$P=\mathbb{P}(H=1|\text{first flip is heads})=p^{n-1}+(1-p^{n-1})\mathbb{P}(H=1|\text{first flip is tails})$$
To compute $\mathbb{P}(H=1|\text{first flip is tails})$, we have two possibilities again: either the following $n-1$ flips are all tails, in which case the probability of obtaining $n$ consecutive heads before $n$ consecutive tails is zero, or somewhere along the line we get a head, in which case we start all over again as if though our first flip had been a head. Thus
$$Q=\mathbb{P}(H=1|\text{first flip is tails})=(1-(1-p)^{n-1})\mathbb{P}(H=1|\text{first flip is heads})$$
We now have the simultaneous equations
$$\begin{align} P&=p^{n-1}+(1-p^{n-1})Q \\ Q &=(1-(1-p)^{n-1})P\end{align}$$
Which implies that $$P=\frac{p^{n-1}}{1-(1-p^{n-1})(1-(1-p)^{n-1})}$$
$$Q=\frac{p^{n-1}(1-(1-p)^{n-1})}{1-(1-p^{n-1})(1-(1-p)^{n-1})}$$
Remembering we had conditioned on the first flip, we now get
$$\mathbb{P}(H=1)=\frac{p^{n}}{1-(1-p^{n-1})(1-(1-p)^{n-1})}+(1-p)p^{n-1}\frac{1-(1-p)^{n-1}}{1-(1-p^{n-1})(1-(1-p)^{n-1})}$$
Using $$\mathbb{E}[C_n]=\mathbb{E}[\mathbb{E}[C_n|H]]=A_n\mathbb{P}(H=1)+B_n(1-\mathbb{P}(H=1))$$
We obtain the desired result. 
