Sort the digits of numbers
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
Consider the sequence of all positive integers from to . Sort the digits of each number in increasing order. Find the sum of obtained numbers.
Input
Two positive integers and .
Output
Print the sum of obtained numbers.
Examples
Let . The numbers from to are: . After sorting the digits in these numbers we get: . Their sum equals to .
Input #1
Answer #1
Submissions 2K
Acceptance rate 46%