This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Implement an algorithm to determine if a string has all unique characters. | |
What if you cannot use additional data structures? | |
*/ | |
/* | |
One solution is to create an array of boolean values, where the flag at index i indicates | |
whether character i in the alphabet is contained in the string. | |
We can also immediately return false if the string length exceeds the number of unique | |
characters in the alphabet. |