Javascript program to count numbers in a range with digit sum divisible by K having first and last digit different
var K ; var N ; var v = [ ] ; var dp = Array . from ( Array ( 20 ) ) ; function init ( x ) { for ( var i = 0 ; i < 20 ; i ++ ) { dp [ i ] = Array . from ( Array ( 1000 ) , ( ) => Array ( 10 ) ) ; for ( var j = 0 ; j < 1000 ; j ++ ) { for ( var k = 0 ; k < 10 ; k ++ ) { dp [ i ] [ j ] [ k ] = Array . from ( Array ( 2 ) , ( ) => Array ( 2 ) . fill ( - 1 ) ) ; } } }