Let $n$ be a positive integer. Then $\varphi(n)$ is defined as the number of integers in the interval $[0,n-1]$ which are relatively prime to $n$, that is, have no factor greater than $1$ in common with $n$. The function $\varphi$ is called the Euler phi-function.
The following result, due to Euler, generalizes Fermat's (little) Theorem.
Theorem: (Euler) Suppose that $a$ is relatively prime to $n$. Then $a^{\varphi(n)}\equiv 1\pmod{n}$. Equivalently, $n$ divides $a^{\varphi(n)}-1$.
Proofs of Euler's Theorem can be found in any book on Elementary Number Theory. In the Wikipedia article on Fermat's Theorem, you will find, fairly deep into the article, a discussion of how to adapt one of the standard proofs of Fermat's Theorem.
Suppose now that $n$ is divisible neither by $2$ nor by $5$, and let $a=10$. Then $a$ and $n$ are relatively prime, and therefore
$$10^{\varphi(n)}\equiv 1\pmod{n}.$$
For any $k\ge 1$, the number $10^k-1$ has decimal representation that consists only of $9$'s. So we have shown that if $n$ is divisible neither by $2$ nor by $5$, then the number consisting of $\varphi(n)$ $9$'s is divisible by $n$.
That gives you a start on solving the problem you are looking at. To use the result, you might want to look up a formula for $\varphi(n)$ in terms of the prime factorization of $n$.
Now we add more detail. There are some small complications in that in your problem, a specific digit is also given. That makes little difference to the analysis, but does affect numbers $n$ that are divisible by $3$ (when the given digit is $3$, $6$, or $9$) and numbers $n$ divisible by $7$ (when the given digit is $7$).
We address a number-theoretically more important complication. It is quite possible that a number "cheaper" than $\varphi(n)$ will do the job. In our case, the number $n$ is odd. Let
$$n=p_1^{a_1}p_2^{a_2}\cdots p_k^{a_k},$$
where the $p_i$ are distinct odd primes. Let $\lambda$ be the least common multiple of the numbers $(p_i-1)p_i^{a_i-1}$. Then it turns out that the number consisting of $\lambda$ $9$'s is divisible by $n$. For numbers $n$ that are divisible by more than $1$ odd prime, we have $\lambda<\varphi(n)$. For details about these ideas, you might want to look into the Carmichael function.
However, $\varphi(n)$, or the (usually improved) estimate $\lambda$ given in the preceding paragraph, will in general not give you the least exponent that does the job.
But once you have found a number $k$ such that $10^k\equiv 1 \pmod{n}$, any cheaper exponent must be a divisor of $k$. For large $n$, this observation can considerably simplify the search for the cheapest exponent. For enormous $n$, the problem can be exceedingly hard computationally.
Best Answer
$10^{50}$ is a 51-digit number. And in a 50-digit number, the digit 26th from the left is represented by $10^{24}$.
Other than these two mistakes, I find your approach entirely reasonable. And if they were looking for a 51-digit number, with all except the 25th digit from the left being $1$, then it would've been correct too.
Edit: After having corrected these two off-by-one errors, the solution looks fine.