New update is available. Click here to update.

Posted: 29 Jun, 2021

Difficulty: Hard

```
Given:
‘L’ = 1, ‘R’ = 23, ‘K’ = 6.
The answer will be 3 since there are three numbers between 1 and 23 whose product of digits is 6, and those are 6, 16, and 23.
```

```
The first line of input contains an integer ‘T’ denoting the number of test cases.
Next, ‘T’ lines consist of three space-separated integers, ‘L’, ‘R’, ‘K’.
```

```
For each test case, return the count of numbers between ‘L’ and ‘R’ whose product of digits is ‘K’.
```

```
You are not required to print the expected output; it has already been taken care of. Just implement the function.
```

```
1 <= ‘T’ <= 10
1 <= ‘L’ <= 10 ^ 8
‘L’ <= ‘R’ <= 10 ^ 8
1 <= ‘K’ <= 10 ^ 4
Time Limit: 1sec.
```

SIMILAR PROBLEMS

NINJA AND HAPPINESS

Posted: 9 Sep, 2022

Difficulty: Hard

DECODE STRING

Posted: 11 Sep, 2022

Difficulty: Moderate

Randomly Sorted

Posted: 13 Nov, 2022

Difficulty: Moderate

Merge Two Sorted Arrays Without Extra Space

Posted: 19 Nov, 2022

Difficulty: Moderate

Co-Prime

Posted: 14 Dec, 2022

Difficulty: Hard

Categories:

Popular Courses: