Stepping Number
In this program we are given with an long integer, if difference of adjacent digit is 1, then it is a stepping number else return -1
Input: 123
Output: 1
Input: 890
Output: -1
Input: 123
Output: 1
Input: 890
Output: -1
Comments
Post a Comment