What is the probability that you chose the coin B Question

Suppose you have two coins A and B the probability of head in A is $\frac{1}{4}$ and the probability of head in B is $\frac{3}{4}$.
Now, suppose you have chosen a coin and tossed it two times.
The output was head and head. What is the probability that you chose the coin B.

My Approach
I used Bayes' theorem ,
Let Event, $\text{output to be Head Head}=E$
Req'd probability=$P({B}\mid{E})$
$$P({B}\mid{E})=\frac{P({E}\mid{B})\times P(B)}{P({E}\mid{B})\times P(B)+P({E}\mid{A})\times P(A)}$$
$$=\frac{\frac{3}{4} \times \frac{3}{4}  \times \frac{1}{2}} {{\frac{3}{4} \times \frac{3}{4}  \times \frac{1}{2}}+{\frac{1}{4} \times \frac{1}{4}  \times \frac{1}{2}}}$$
$$=\frac{9}{10}$$
Am i correct?
 A: I am not aware of Bayes' theorem but I have also reached the answer of $\frac{9}{10}$.
If you are using coin A, then the probability of getting double heads is $\frac{1}{4}*\frac{1}{4}=\frac{1}{16}$.
If you are using coin B, then the probability of getting double heads is $\frac{3}{4}*\frac{3}{4}=\frac{9}{16}$.
We can now take this as a ratio of probabilities:
$$\frac{1}{16}:\frac{9}{16}$$
$$=1:9$$
$\therefore$ the probability of the coin you chose being coin B is $\frac{9}{10}$.
(I don't know if this is a mathematically viable way of getting the answer. It is just something that came into my head so if this doesn't work then just mention it in the comments and I will gladly delete the post.)
A: 
Am i correct?

Yes, that is correct.
The answer is $\mathsf P(B\mid E)=9/10$.   Obtaining two heads is strong evidence that the coin is biased towards heads, so you should anticipate the answer will be somewhat greater than $\mathsf P(B)$.

By Bayes' Rule: $~\mathsf P(B\mid E) = \mathsf P(E\mid B)\cdot \mathsf P(B)~/~\mathsf P(E)$
By Law of Total Probability (and that events $A,B$ are disjoint and exhaustive (ie partition the space)): $~\mathsf P(E)=\mathsf P(E\cap B)+\mathsf P(E\cap A)$
So, putting this together: $$\mathsf P(B\mid E)=\dfrac{\mathsf P(E\mid B)~\mathsf P(B)}{\mathsf P(E\mid B)~\mathsf P(B)+\mathsf P(E\mid A)~\mathsf P(A)}$$
Everything else is just substituting the appropriate evaluations and doing the calculations, which you have done.
