taking n + 1 for simplicity - count [ i ] [ j ] will store number count starting with digit i and length j
int count [ 10 ] [ n + 1 ] ; int i = 0 , j = 0 , k = 0 , move = 0 , ro = 0 , co = 0 , num = 0 ; int nextNum = 0 , totalCount = 0 ;