Question
Needed Answer in C# A lucky number is a 10-based number, which has at least a 6 or an 8 in its digits. However, if
Needed Answer in C#
A lucky number is a 10-based number, which has at least a "6" or an "8" in its digits. However, if it has "6" and "8" at the same time, then the number is NOT lucky. For example, "16", "38", "666" are lucky numbers, while "234" , "687" are not. Now we want to know how many lucky numbers (without leading zeroes) are there between L and R, inclusive?
Input
Line 1: Two integers, L and R.
Output
Line 1: An integer, indicating the amount of lucky numbers between [ L , R ].
Constraints
1 L R 10^18
Example 1
Input
92871036442 3363728910382456
Output
1160053175781729
Example 2
Input
1 1000000000000000000
Output
264160473575034274
I want the solution to work for these particular two examples and it should be in C# please.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started