Number of Permutations
Very easy
Execution time limit is 2 seconds
Runtime memory usage limit is 256 megabytes
Two distinct positive integers with decimal notations of the same length are called similar, if their decimal notations can be obtained from each other by permuting the digits.
How many numbers from the segment [l, r] have exactly one similar number in that segment?
Input
Contains two integer numbers l and r (1 ≤ l ≤ r ≤ 10^15
).
Output
Print the required amount.
Examples
Input #1
Answer #1
Submissions 41
Acceptance rate 66%