If not present , then add it to result .
if ( j == i ) { str [ index ++ ] = str [ i ] ; } } char [ ] ans = new char [ index ] ; Array . Copy ( str , ans , index ) ; return String . Join ( " " , ans ) ; }