I need to check in Java if a word consists of unique letters (case insensitive). As straight solution is boring, I came up with:
An improvement on option 2 is to check the boolean flag that the HashSet add method returns. It's true if the object wasn't already there. Though, for this method to be at all useful you'd first have to set the string to all caps or lowercase.