Now traverse the number string to find and increment result whenever a digit divides N .
let result = 0 ; for ( let i = 0 ; i < N . length ; i ++ ) { if ( divide [ N [ i ] - ' ' ] == true ) result ++ ; } return result ; }