Digit DP naturally counts from to . But problems often ask for a range . Use inclusion-exclusion: Compute the count up to , subtract the count up to .
You run digit DP twice with different limits. Watch for edge cases: if , you might need to handle it specially since is invalid. Some problems exclude from the count.