Number of Digit One
HardLeetCodeAdvanced DP (Bitmask, Digit, Interval)
Approach hintTry it first, then revealHide
Count contributions position by position: for each power of ten, the digits to the left and to the right of that position decide how many times a 1 appears there. A digit DP carrying the number of ones so far also works.