Practice Count Stepping Numbers in Range
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
Given two positive integers low and high represented as strings, find the count of stepping numbers in the inclusive range [low, high]. A stepping number is an integer such that all of its adjacent digits have an absolute difference of exactly 1. Return an integer denoting the count of stepping numbers in the inclusive range [low, high]. Since the answer may be very large, return it modulo 10^9 + 7. Note: A stepping number should not have a leading zero.
Source: Count Stepping Numbers in Range on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
low = "1", high = "11"
10
# Example 2
low = "90", high = "101"
2
Constraints
Related LeetCode Problems
Practice more problems similar to Count Stepping Numbers in Range.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.