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

Comments

Popular posts from this blog

Reasoning-Number Series

Reasoning-Letter Series

Multiply Negative numbers in java