print the required array
for ( int i = 0 ; i < n ; ++ i ) { if ( prime [ arr [ i ] ] == true ) System . out . print ( arr [ i ] + " ▁ " ) ; else { System . out . print ( v . get ( j ) + " ▁ " ) ; j ++ ; } } }