Marks :20
: 3 | : 0
You are given 4 integers L,R,X,Y.
Your task is to count how many numbers exist between L and R are there (both inclusive) with given property:
The count of digits with odd frequency =X and count of digits with even frequency =Y
Consider digits with 0 frequency as even frequency.
Since the answer could be very large, return the answer modulo 109+7
The input consists of 4 space separated integers as: L R X Y
X + Y = 10
1≤L≤R<101000
Print the count of such integers described in the above problem statement modulo 109+7 .
1 1000 0 10
9
1 1000 10 0
0
In first test case where L=1, R=1000, X=0, Y=10.
Following are the solutions 11,22,33,44,55,66,77,88,99.
All satisfy the above given property.
For Example consider 11
digit | frequency |
0 | 0 |
1 | 2 |
2 | 0 |
3 | 0 |
4 | 0 |
5 | 0 |
6 | 0 |
7 | 0 |
8 | 0 |
9 | 0 |
You need to login to view your submissions.
You need to login to view all submissions.
Result : Executed
Feel something is wrong with the test cases?
Result : Accepted
Test Cases :
But to Run or Submit the Problem, you need to Log In.
Continue to Log InYour challenge has been submitted successfully.
You will get a response soon via WhatsApp or Email.
Do let us know your issue.