The character after the # is added after the character at position rem_ind1
else if ( s . charAt ( i ) != ' # ' ) { s . setCharAt ( ps + 1 , s . charAt ( i ) ) ; ps += 1 ; } } pt = - 1 ; for ( i = 0 ; i < t . length ( ) ; i ++ ) {