##
Print all n-digit numbers with absolute difference between sum of even and odd digits is 1
July 31, 2016

Given number of digits n, print all n-digit numbers whose absolute difference between sum of digits at even and odd positions is 1. Solution should not consider leading 0’s as digits. Examples: Input: n = 2 Output: 10 12 21 23 32 34 43 45 54 56 65 67 76 78 87 89 98 Input:… Read More »