If yes , print it and all subsequent occurrences
Console . Write ( arr [ i ] + " ▁ " ) ; for ( int j = i + 1 ; j < n ; j ++ ) { if ( arr [ i ] == arr [ j ] ) { Console . Write ( arr [ i ] + " ▁ " ) ; visited [ j ] = true ; } } } } }