If we find a factor other than 1 , then appending it to the final factor array
if ( factor != 1 ) newvec . push_back ( factor ) ; } set < int > s ; for ( int i = 0 ; i < newvec . size ( ) ; i ++ ) s . insert ( newvec [ i ] ) ; for ( auto i = s . begin ( ) ; i != s . end ( ) ; i ++ ) cout << ( * i ) << " ▁ " ; }