Efficiently check if a string has all unique characters without using any additional data structure | Driver code
function unique ( s ) { for ( var i = 0 ; i < s . length ; i ++ ) { if ( s . charAt ( i ) == s . charAt ( i + 1 ) ) { return false ; } } return true ; } if ( unique ( " " ) == true ) { document . write ( " " ) ; } else { document . write ( " " ) ; }