# Number of integers containing every digit atleast once

I have to find out number of integers that have every digit $(0-9)$ in it where integer starting with zero doesn't count i.e leading zero shouldn't be there. So this makes the length of an integer $\ge 10$.

For eg - for $10$ length $1234567890,9876543201,4567891023$ and so on

For 11 length = $12345678900, 12345678009$ and so on..

For $19$ length =$1122334556677889900,99887766554433220011$ and so on..

Now given a range $L,R$ I need to find out how many such integers falls in between them. Now I was trying out all combinations and checking if it lies within range. Is there a way to apply permutation and combination to do so efficiently and smartly ?

• what about 11234567890? that has length 11... – danimal Apr 10 '17 at 15:05
• @danimal Yeah it will count. Oops I forgot to take them into account. I updated my question. – S.H. Apr 10 '17 at 15:07
• @user2460798 Yes they can be repeated otherwise how else would they make up integers of more than $9$ length ? – S.H. Apr 10 '17 at 15:10
• @BarryCipra No. Sorry it's an error on my part. You are right, it should be "10 length" and "11 length" – S.H. Apr 10 '17 at 15:28
• @N.Shales I think he said range of numbers not range of number of digits ! – Rezwan Arefin Apr 11 '17 at 13:39