Probability of choosing the right coin given the number of tosses I'm trying to solve the following problem

There are two indistinguishable coins, one of them is balanced and the other one is biased in a way that the probability of getting heads after a toss is twice the probability of getting tails after a toss.
We choose one of them and toss it repeatedly. Find the probability of having chosen the balanced coin if
i) The coin was tossed $15$ times and $5$ of them were heads.
ii) We needed $15$ tosses to get $5$ heads.

Here is my attempt:
i) Let $B$ be the event of choosing the balanced coin and let $D$ be the event of choosing the coin with "probability of heads=double of probability of tails". Consider the random variable $X$ counting the number of heads obtained.
We have$$\mathbb{P}(X=5\mid B)=\binom{15}{5}\left (\frac{1}{2}\right )^5\left (\frac{1}{2}\right )^{15-5}=\frac{3003}{2^{15}}$$because if $B$ was chosen then $X\sim \operatorname{Bin}\left (15,\frac{1}{2}\right )$ and$$\mathbb{P}(X=5\mid D)=\binom{15}{5}\left (\frac{2}{3}\right )^5\left (\frac{1}{3}\right )^{15-5}=\frac{96096}{3^{15}}$$because if $D$ was chosen then $X\sim \operatorname{Bin}\left (15,\frac{2}{3}\right )$. We also have $\mathbb{P}(B)=\mathbb{P}(D)=\frac{1}{2}$ because the coins are indistinguishable. Hence using Bayes' Theorem we find$$\mathbb{P}(B\mid X=5)=\frac{\mathbb{P}(X=5\mid B)\cdot \mathbb{P}(B)}{\mathbb{P}(X=5\mid B)\cdot \mathbb{P}(B)+\mathbb{P}(X=5\mid D)\cdot \mathbb{P}(D)}=\frac{\frac{3003}{2^{15}}}{\frac{96096}{3^{15}}}\approx 0.93$$as the desired probability.
ii) Let $B$ be the event of choosing the balanced coin and let $D$ be the event of choosing the coin with "probability of heads=double of probability of tails". Consider the random variable $X$ counting the number of tosses needed to obtain $5$ heads.
We have$$\mathbb{P}(X=15\mid B)=\dbinom{15-1}{5-1}\left (\dfrac{1}{2}\right )^5\left (\dfrac{1}{2}\right )^{15-5}=\dbinom{14}{4}\dfrac{1}{2^{15}}$$because if $B$ was chosen then $X\sim \operatorname{Pa}\left (\frac{1}{2},5\right )$ and$$\mathbb{P}(X=15\mid D)=\dbinom{15-1}{5-1}\left (\dfrac{2}{3}\right )^5\left (\dfrac{1}{3}\right )^{15-5}=\dbinom{14}{4}\dfrac{2^5}{3^{15}}$$because if $D$ was chosen then $X\sim \operatorname{Pa}\left (\frac{1}{3},5\right )$. Then similar computations give the same answer as the first item.
I would like to know if my solution is correct.

Your solution looks right to me. You get the same result in both parts because the dependence of the probabilities on the data is the same; the overall factor of $\frac13$ that comes from the additional constraint that the last toss resulted in heads is the same for the two coins and cancels out.
