Function to find out frequency of numbers from 1 to N having their sum of digits from 1 to 162 and store them in array
function formArray ( N ) { let dp = new Array ( 20 ) ; for ( let i = 0 ; i < 20 ; i ++ ) { dp [ i ] = new Array ( 2 ) ; for ( let j = 0 ; j < 2 ; j ++ ) { dp [ i ] [ j ] = new Array ( 166 ) ; for ( let k = 0 ; k < 166 ; k ++ ) { dp [ i ] [ j ] [ k ] = - 1 ; } } }