InterviewBit Academy is now Scaler!
InterviewBit Academy is now Scaler Academy!

Strobogrammatic Number III

A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down).

Write a function to count the total strobogrammatic numbers that exist in the range of A <= num <= B.

Note: Since A and B are very big they are given in input as strings

Input Format:

    First argument contains a string A.
    Second argument contains a string B.

Output Format:

Return a single integer denoting the count.


1 <= A <= B <= 10^15

For Example:

Input 1:
    A = 50, B = 100
Output 1:
    69, 88 and 96 are 3 strobogrammatic numbers.
Input 2:
    A = 1, B = 10
Output 2:
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a doubt? Checkout Sample Codes for more details.
Start solving Strobogrammatic Number III on Interview Code Editor
Sign Up
to access hints and editorial solutions for Strobogrammatic Number III


Click here to start solving coding interview questions