Search
⌘K
Get Premium
Leetcode 2801. Count Stepping Numbers in Range
Count how many integers in the inclusive range [low, high] (given as decimal strings up to 100 digits) have every pair of adjacent digits differ by exactly 1 and no leading zeros, returning the result modulo 1e9+7. The core challenge is handling enormous bounds efficiently (typically via digit-DP or equivalent) to count valid numbers up to high and subtract those below low.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.