stores the frequency of all single digit in three - digit number
var freq = new Array ( 10 ) . fill ( 0 ) ; freq [ parseInt ( dup % 10 ) ] ++ ; dup = dup / 10 ; freq [ parseInt ( dup % 10 ) ] ++ ; dup = dup / 10 ; freq [ parseInt ( dup % 10 ) ] ++ ; dup = i ;