Tap here to switch tabs
Problem
Submissions

Problem: Digit Count in Range

med
30 min
Try to solve the Digit Count in Range problem.

Statement

Given an integer d along with two integers low and high, return the total number of times the digit d appears across all integers in the inclusive range from low to high.

Constraints:

  • 0≤0 \leq d ≤9\leq 9

  • 1≤1 \leq low ≤\leq high ≤2imes108\leq 2 imes 10^8

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Digit Count in Range

med
30 min
Try to solve the Digit Count in Range problem.

Statement

Given an integer d along with two integers low and high, return the total number of times the digit d appears across all integers in the inclusive range from low to high.

Constraints:

  • 0≤0 \leq d ≤9\leq 9

  • 1≤1 \leq low ≤\leq high ≤2imes108\leq 2 imes 10^8