Problem Statement | |||||||||||||
A jumpy number is a positive integer, all of whose adjacent digits differ by at
least 2. For example,
NOT JUMPY: 28459, 28549, 1091919, 97753, 111111
JUMPY: 290464, 13131313, 97539753, 5
Create a class JumpyNum that contains a method howMany that is given low and
high and returns the number of jumpy numbers that are between low and high,
inclusive.
| |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Constraints | |||||||||||||
| - | low is between 1 and 2,000,000,000, inclusive. | ||||||||||||
| - | high is between low and 2,000,000,000, inclusive. | ||||||||||||
Examples | |||||||||||||
| 0) | |||||||||||||
| |||||||||||||
| 1) | |||||||||||||
| |||||||||||||
| 2) | |||||||||||||
| |||||||||||||
| 3) | |||||||||||||
| |||||||||||||