🏡 index : github.com/captn3m0/codechef.git

---
{"languages_supported":{"0":"NA"},"title":"ARRANGE2","category":"NA","old_version":true,"problem_code":"ARRANGE2","tags":{"0":"NA"},"layout":"problem"}
---

<h3> All submissions for this problem are available. </h3><p>
A number X is called Permut number if X and 2X ( both without leading zeroes ) have same number of digits and are permutations of each other. Given A and B, find the number of Permut numbers &gt;= A and &lt;= B.
</p>

<p>
Note : X is called permutation of Y if every digit ( 0 - 9 ) occurs same number of times in both the numbers ( maybe at different positions ).
</p>

<p>
Input :
</p>
<p>
The first line contains the number of test cases T. T lines follow, containing two integers A and B.
</p>

<p>
Output :
</p>
<p>
Output T lines, one for each test case containing the desired answer for the corresponding test case.
</p>

<pre>
Sample Input :
2
1 100
499875921 499875921

</pre>

<pre>
Sample Output :
0
1

</pre>

<pre>
Constraints :
1 &lt;= T &lt;= 10000
1 &lt;= A &lt;= B &lt;= 10000000000 (10^10)
</pre>