If $a$ and $b$ are very large numbers, then you can use the following. I will assume that the $a_i$'s are relatively prime (to simplify).
Let $c=\prod_{i=1}^Na_i$.
Then, the number of integers less than $c$ which are divisible by $a_1$ is $\prod_{i=2}^Na_i$, the number of integers less than $c$ which are divisible by $a_1$ and $a_2$ is $\prod_{i=3}^Na_i$.
In general, using the inclusion/exclusion principle, we know that the number of integers relatively prime to $a_1,\cdots,a_n$ is given by (where $S=\{1,\cdots,N\}$)
$$
\prod_{i=1}^Na_i-\sum_{A\subseteq S,|A|=|S|-1}\prod_{i\in S}a_i+\sum_{A\subseteq S,|A|=|S|-2}\prod_{i\in S}a_i-\sum_{A\subseteq S,|A|=|S|-3}\prod_{i\in S}a_i+\cdots+(-1)^N
$$
These are the coefficients of the polynomial $\prod(a_i-x)$. So, then, we can calculate the number of integers less than or equal to $c$ relatively prime to the $a_i$'s by substituting $1$ for $x$ and multiplying which takes $O(N)$.
In fact, any sequence of integers of length $c$ will have exactly this many integers relatively prime to the $a_i$'s. So, you could calculate the number of integers less than $m$ which are relatively prime to the $a_i$'s where $1\leq m\leq c\leq 10^{360}$ and break up the interval between $b$ and $a$ into blocks of size $c$ and use a table to look up the rest.
This can give an algorithm that is around $O(N)$ (around because I'm ignoring bit complexity of multiplication) - but the constant is HUGE (at least $10^{360}$).
The structure of the analysis is the same as yours. We count the bad strings, where some digit appears exactly twice.
We first count the strings where say the digit $0$ appears exactly twice. Where the $0$'s are can be chosen in $\binom{5}{2}$ ways. For each of these ways, the remaining $3$ places can be filled in $9^3$ ways.
So our first estimate of the number of bad strings is $(10)\binom{5}{2}(9^3)$.
But we have double-counted, for example, the strings where $0$ and $1$ appear exactly twice. There are $\binom{5}{2}$ ways to choose where the $0$'s go, and for each there are $\binom{3}{2}$ ways to choose where the $1$'s go. The remaining spot can be filled in $8$ ways. Multiply by $\binom{10}{2}$ for the number of ways to choose the two digits that appear twice.
Putting things together, we find that the number of bad strings is
$$(10)\binom{5}{2}(9^3)-\binom{10}{2}\binom{5}{2}\binom{3}{2}(8).\tag{1}$$
Finally, subtract (1) from $10^5$.
Best Answer
A number is even or a multiple of 5 exactly when it's final digit is one of $\{0,2,4,5,6,8\}$. There are $9$ possible choices for the first digit, $10$ choices for digits 2 to 5, and $6$ choices for the final digit, making a total of $9 \times 10^4 \times 6 = 540,000$ such numbers.
If you want to use the principle of inclusion-exclusion, observe that a number is even exactly when it ends in one of $\{0,2,4,6,8\}$, and is divisible by 5 exactly when the final digit is one of $\{0,5\}$. So, if a number is both even and divisible by 5, it must end in $0$, as the only number in both lists.
You have calculated $|A|$ and $|B|$ correctly, hopefully it is now clear that $|A \cap B|$ is just $9 \times 10^4$, and the final answer can be obtained with the inclusion-exclusion formula as you had in your question: $$9 \times 10^4 \times 5 + 9 \times 10^4 \times 2 - 9 \times 10^4 = 9 \times 10^4 \times 6 = 540,000.$$