Algorithms
Hard
2801
2921
Count Stepping Numbers in Range
count-stepping-numbers-in-range
"""
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 109 + 7.

Note: A stepping number should not have a leading zero.

Example 1:

Input: low = "1", high = "11"
Output: 10
Explanation: The stepping numbers in the range [1,11] are 1, 2, 3, 4, 5, 6, 7, 8, 9 and 10. There are a total of 10 stepping numbers in the range. Hence, the output is 10.

Example 2:

Input: low = "90", high = "101"
Output: 2
Explanation: The stepping numbers in the range [90,101] are 98 and 101. There are a total of 2 stepping numbers in the range. Hence, the output is 2.

Constraints:

 * 1 <= int(low) <= int(high) < 10100
 * 1 <= low.length, high.length <= 100
 * low and high consist of only digits.
 * low and high don't have any leading zeros.
"""
class Solution:
    def countSteppingNumbers(self, low: str, high: str) -> int:
        
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 109 + 7.

Note: A stepping number should not have a leading zero.

Example 1:

Input: low = "1", high = "11"
Output: 10
Explanation: The stepping numbers in the range [1,11] are 1, 2, 3, 4, 5, 6, 7, 8, 9 and 10. There are a total of 10 stepping numbers in the range. Hence, the output is 10.

Example 2:

Input: low = "90", high = "101"
Output: 2
Explanation: The stepping numbers in the range [90,101] are 98 and 101. There are a total of 2 stepping numbers in the range. Hence, the output is 2.

Constraints:

 * 1 <= int(low) <= int(high) < 10100
 * 1 <= low.length, high.length <= 100
 * low and high consist of only digits.
 * low and high don't have any leading zeros.


Please complete the code below to solve above prblem:
```python
class Solution:
    def countSteppingNumbers(self, low: str, high: str) -> int:
        
```

my_solution = Solution()

test_input = { "low": "1", "high": "11" }
assert my_solution.countSteppingNumbers(**test_input) == 10

test_input = { "low": "90", "high": "101" }
assert my_solution.countSteppingNumbers(**test_input) == 2

test_input = { "low": "2", "high": "40" }
assert my_solution.countSteppingNumbers(**test_input) == 14

test_input = { "low": "26", "high": "60" }
assert my_solution.countSteppingNumbers(**test_input) == 6

test_input = { "low": "40", "high": "70" }
assert my_solution.countSteppingNumbers(**test_input) == 6

test_input = { "low": "46", "high": "66" }
assert my_solution.countSteppingNumbers(**test_input) == 3

test_input = { "low": "58", "high": "58" }
assert my_solution.countSteppingNumbers(**test_input) == 0

test_input = { "low": "23", "high": "99" }
assert my_solution.countSteppingNumbers(**test_input) == 14

test_input = { "low": "44", "high": "86" }
assert my_solution.countSteppingNumbers(**test_input) == 7

test_input = { "low": "20", "high": "111" }
assert my_solution.countSteppingNumbers(**test_input) == 16

test_input = { "low": "70", "high": "75" }
assert my_solution.countSteppingNumbers(**test_input) == 0

test_input = { "low": "37", "high": "111" }
assert my_solution.countSteppingNumbers(**test_input) == 12

test_input = { "low": "17", "high": "149" }
assert my_solution.countSteppingNumbers(**test_input) == 18

test_input = { "low": "21", "high": "145" }
assert my_solution.countSteppingNumbers(**test_input) == 18

test_input = { "low": "47", "high": "124" }
assert my_solution.countSteppingNumbers(**test_input) == 12

test_input = { "low": "81", "high": "91" }
assert my_solution.countSteppingNumbers(**test_input) == 2

test_input = { "low": "18", "high": "159" }
assert my_solution.countSteppingNumbers(**test_input) == 18

test_input = { "low": "85", "high": "92" }
assert my_solution.countSteppingNumbers(**test_input) == 2

test_input = { "low": "66", "high": "112" }
assert my_solution.countSteppingNumbers(**test_input) == 7

test_input = { "low": "84", "high": "102" }
assert my_solution.countSteppingNumbers(**test_input) == 4

test_input = { "low": "41", "high": "156" }
assert my_solution.countSteppingNumbers(**test_input) == 14

test_input = { "low": "64", "high": "135" }
assert my_solution.countSteppingNumbers(**test_input) == 10

test_input = { "low": "57", "high": "143" }
assert my_solution.countSteppingNumbers(**test_input) == 10

test_input = { "low": "85", "high": "116" }
assert my_solution.countSteppingNumbers(**test_input) == 4

test_input = { "low": "103", "high": "104" }
assert my_solution.countSteppingNumbers(**test_input) == 0

test_input = { "low": "98", "high": "118" }
assert my_solution.countSteppingNumbers(**test_input) == 2

test_input = { "low": "28", "high": "197" }
assert my_solution.countSteppingNumbers(**test_input) == 16

test_input = { "low": "6", "high": "220" }
assert my_solution.countSteppingNumbers(**test_input) == 26

test_input = { "low": "106", "high": "121" }
assert my_solution.countSteppingNumbers(**test_input) == 1

test_input = { "low": "7", "high": "226" }
assert my_solution.countSteppingNumbers(**test_input) == 25

test_input = { "low": "105", "high": "136" }
assert my_solution.countSteppingNumbers(**test_input) == 2

test_input = { "low": "30", "high": "221" }
assert my_solution.countSteppingNumbers(**test_input) == 18

test_input = { "low": "113", "high": "139" }
assert my_solution.countSteppingNumbers(**test_input) == 2

test_input = { "low": "44", "high": "210" }
assert my_solution.countSteppingNumbers(**test_input) == 14

test_input = { "low": "13", "high": "242" }
assert my_solution.countSteppingNumbers(**test_input) == 22

test_input = { "low": "12", "high": "257" }
assert my_solution.countSteppingNumbers(**test_input) == 23

test_input = { "low": "70", "high": "205" }
assert my_solution.countSteppingNumbers(**test_input) == 8

test_input = { "low": "55", "high": "229" }
assert my_solution.countSteppingNumbers(**test_input) == 13

test_input = { "low": "16", "high": "276" }
assert my_solution.countSteppingNumbers(**test_input) == 22

test_input = { "low": "140", "high": "153" }
assert my_solution.countSteppingNumbers(**test_input) == 0

test_input = { "low": "79", "high": "218" }
assert my_solution.countSteppingNumbers(**test_input) == 8

test_input = { "low": "99", "high": "200" }
assert my_solution.countSteppingNumbers(**test_input) == 3

test_input = { "low": "90", "high": "210" }
assert my_solution.countSteppingNumbers(**test_input) == 5

test_input = { "low": "123", "high": "186" }
assert my_solution.countSteppingNumbers(**test_input) == 1

test_input = { "low": "149", "high": "160" }
assert my_solution.countSteppingNumbers(**test_input) == 0

test_input = { "low": "138", "high": "180" }
assert my_solution.countSteppingNumbers(**test_input) == 0

test_input = { "low": "160", "high": "163" }
assert my_solution.countSteppingNumbers(**test_input) == 0

test_input = { "low": "79", "high": "246" }
assert my_solution.countSteppingNumbers(**test_input) == 10

test_input = { "low": "137", "high": "189" }
assert my_solution.countSteppingNumbers(**test_input) == 0

test_input = { "low": "163", "high": "163" }
assert my_solution.countSteppingNumbers(**test_input) == 0

test_input = { "low": "37", "high": "289" }
assert my_solution.countSteppingNumbers(**test_input) == 18

test_input = { "low": "79", "high": "255" }
assert my_solution.countSteppingNumbers(**test_input) == 10

test_input = { "low": "140", "high": "197" }
assert my_solution.countSteppingNumbers(**test_input) == 0

test_input = { "low": "22", "high": "317" }
assert my_solution.countSteppingNumbers(**test_input) == 21

test_input = { "low": "146", "high": "199" }
assert my_solution.countSteppingNumbers(**test_input) == 0

test_input = { "low": "57", "high": "288" }
assert my_solution.countSteppingNumbers(**test_input) == 14

test_input = { "low": "109", "high": "237" }
assert my_solution.countSteppingNumbers(**test_input) == 6

test_input = { "low": "48", "high": "299" }
assert my_solution.countSteppingNumbers(**test_input) == 16

test_input = { "low": "158", "high": "194" }
assert my_solution.countSteppingNumbers(**test_input) == 0

test_input = { "low": "29", "high": "326" }
assert my_solution.countSteppingNumbers(**test_input) == 22

test_input = { "low": "133", "high": "223" }
assert my_solution.countSteppingNumbers(**test_input) == 2

test_input = { "low": "109", "high": "249" }
assert my_solution.countSteppingNumbers(**test_input) == 6

test_input = { "low": "20", "high": "341" }
assert my_solution.countSteppingNumbers(**test_input) == 24

test_input = { "low": "9", "high": "352" }
assert my_solution.countSteppingNumbers(**test_input) == 29

test_input = { "low": "115", "high": "253" }
assert my_solution.countSteppingNumbers(**test_input) == 6

test_input = { "low": "181", "high": "188" }
assert my_solution.countSteppingNumbers(**test_input) == 0

test_input = { "low": "120", "high": "250" }
assert my_solution.countSteppingNumbers(**test_input) == 6

test_input = { "low": "100", "high": "273" }
assert my_solution.countSteppingNumbers(**test_input) == 7

test_input = { "low": "105", "high": "269" }
assert my_solution.countSteppingNumbers(**test_input) == 6

test_input = { "low": "189", "high": "190" }
assert my_solution.countSteppingNumbers(**test_input) == 0

test_input = { "low": "148", "high": "237" }
assert my_solution.countSteppingNumbers(**test_input) == 4

test_input = { "low": "126", "high": "267" }
assert my_solution.countSteppingNumbers(**test_input) == 4

test_input = { "low": "141", "high": "252" }
assert my_solution.countSteppingNumbers(**test_input) == 4

test_input = { "low": "185", "high": "209" }
assert my_solution.countSteppingNumbers(**test_input) == 0

test_input = { "low": "14", "high": "381" }
assert my_solution.countSteppingNumbers(**test_input) == 26

test_input = { "low": "7", "high": "388" }
assert my_solution.countSteppingNumbers(**test_input) == 31

test_input = { "low": "15", "high": "383" }
assert my_solution.countSteppingNumbers(**test_input) == 26

test_input = { "low": "78", "high": "325" }
assert my_solution.countSteppingNumbers(**test_input) == 13

test_input = { "low": "131", "high": "274" }
assert my_solution.countSteppingNumbers(**test_input) == 4

test_input = { "low": "177", "high": "230" }
assert my_solution.countSteppingNumbers(**test_input) == 2

test_input = { "low": "66", "high": "346" }
assert my_solution.countSteppingNumbers(**test_input) == 17

test_input = { "low": "144", "high": "271" }
assert my_solution.countSteppingNumbers(**test_input) == 4

test_input = { "low": "96", "high": "322" }
assert my_solution.countSteppingNumbers(**test_input) == 9

test_input = { "low": "112", "high": "307" }
assert my_solution.countSteppingNumbers(**test_input) == 6

test_input = { "low": "73", "high": "349" }
assert my_solution.countSteppingNumbers(**test_input) == 16

test_input = { "low": "128", "high": "296" }
assert my_solution.countSteppingNumbers(**test_input) == 4

test_input = { "low": "189", "high": "237" }
assert my_solution.countSteppingNumbers(**test_input) == 4

test_input = { "low": "141", "high": "286" }
assert my_solution.countSteppingNumbers(**test_input) == 4

test_input = { "low": "47", "high": "382" }
assert my_solution.countSteppingNumbers(**test_input) == 20

test_input = { "low": "27", "high": "411" }
assert my_solution.countSteppingNumbers(**test_input) == 24

test_input = { "low": "16", "high": "423" }
assert my_solution.countSteppingNumbers(**test_input) == 26

test_input = { "low": "22", "high": "417" }
assert my_solution.countSteppingNumbers(**test_input) == 25

test_input = { "low": "174", "high": "266" }
assert my_solution.countSteppingNumbers(**test_input) == 4

test_input = { "low": "101", "high": "342" }
assert my_solution.countSteppingNumbers(**test_input) == 9

test_input = { "low": "76", "high": "370" }
assert my_solution.countSteppingNumbers(**test_input) == 16

test_input = { "low": "147", "high": "301" }
assert my_solution.countSteppingNumbers(**test_input) == 4

test_input = { "low": "72", "high": "376" }
assert my_solution.countSteppingNumbers(**test_input) == 16

test_input = { "low": "154", "high": "297" }
assert my_solution.countSteppingNumbers(**test_input) == 4

test_input = { "low": "15", "high": "439" }
assert my_solution.countSteppingNumbers(**test_input) == 28

test_input = { "low": "73", "high": "381" }
assert my_solution.countSteppingNumbers(**test_input) == 16