Created a 2D array to store minimum two multiple of any particular i .
var mul = Array . from ( Array ( mx + 1 ) , ( ) => Array ( ) ) ; for ( var i = 0 ; i < n ; i ++ ) { if ( mul [ arr [ i ] ] . length > 1 ) {