If number has exactly K factors push in result [ ]
if ( count == k ) { result . push ( i ) ; } } let p = result . length ; for ( let index = 0 ; index < p - 1 ; index ++ ) { let element = result [ index ] ; let count = 1 , z = index ;