PROBLEM STATEMENT
John and Brus believe that the digits 4 and 7 are lucky and all others are not.
According to them, an almost lucky number is a number that contains at most one non-lucky digit in
its decimal representation.
Return the total number of almost lucky numbers between a and b, inclusive.
DEFINITION
Class:TheAlmostLuckyNumbersDivOne
Method:find
Parameters:long long, long long
Returns:long long
Method signature:long long find(long long a, long long b)
CONSTRAINTS
-a will be between 1 and 10^16, inclusive.
-b will be between a and 10^16, inclusive.
EXAMPLES
0)
4
7
Returns: 4
All numbers between 4 and 7 are almost lucky.
1)
8
19
Returns: 4
Numbers 8, 9, 14 and 17 are almost lucky.
2)
28
33
Returns: 0
No almost lucky numbers here.
3)
12345678900
98765432100
Returns: 91136
This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2010, TopCoder, Inc. All rights reserved.