Print only if this character is not printed before
if ( d . has ( element ) && d . get ( element ) != 0 ) { document . write ( element + d . get ( element ) + " " ) ; d . set ( element , 0 ) ; } } ) ; }