3 Numbers

You are given three numbers A, B, C. You have to find the count of positive integer X such that A * XX is a C digit number in base B.

Input Format:

    First argument contains a integer A.
    Second argument contains a integer B.
    Third argument contains a integer C.

Ouput Format:

    Return a single integer denoting count of X

Constriants:

    1 <= A, C <= 10^9
    2 <= B <= 10^9

For Example:

Input 1:
    A = 1, B = 10, C = 2
Output 1:
    1
Explanation 1:
    x = 3 will satisfy the above condition. Only one answer is present.
Input 2:
    A = 4, B = 55, C = 1
Output 2:
    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 3 Numbers on Interview Code Editor
Sign Up
to access hints and editorial solutions for 3 Numbers

Discussion


Loading...
Click here to start solving coding interview questions