Determining a string has all unique characters without using additional data structures and without the lowercase characters assumption
This is one of the questions in the Cracking the Coding Interview book by Gayle Laakmann McDowell: Implement an algorithm to determine if a string has all unique characters. What if you can not use additional data structures? The author wrote: We can reduce our space usage a little bit by using a bit vector. We will assume, in the below code, that the string is only lower case 'a' through 'z' . This will allow us to use just a single int. The author has this implementation: public static boolean isUniqueChars(String str) { int checker = 0; for (int i = 0; i < str.length(); ++i) { int val = str