Problem 3966 · Hard

Count Good Integers in a Range

Count integers up to a bound with a digit DP that remembers the previous digit, then subtract the counts for l - 1 and r.

Open the interactive visualisation