I tried to solve this problem, and I used something similar to the probability of the Bernoulli distribution to find how many tosses you need to obtain a probability of almost one for one occurrence. Then I just divide the number of tosses in the problem statement by the number of tosses I get.
Is there a better way to do this?
Edit: What I tried is
m = $12$
N = $10^6$
Probability of having X = "m heads followed by m tails" is $\frac{1}{2^m}$
Probability of X at exactly at position i is $1/2^m*(1-1/2^m)^i$
Probability of X after p tries is $\sum_{i=0}^{p}1/2^m*(1-1/2^m)^i =1-(1-1/2^m)^{p+1}$
Now when p is big enough the probability is 1. And then I can just divide . But it depends what you define as big enough and lead to speculative results. There must be a solution based on statistics but It's been a while and I forgot quite a bit.