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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!