Improved version of checking for uniqueness of chars

Taken from Cracking the Coding Interview answers