Print the new string
for ( let i = 0 ; i < n ; i ++ ) { if ( str [ i ] == str [ n - 1 ] ) document . write ( ' ' ) ; else document . write ( ' ' ) ; } return ; } else { for ( let i = 0 ; i < n ; i ++ ) {