Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

unique character 03

class UniqueChars(object):

    def has_unique_chars(self, string):
        if string is None:
            return False
        chars_set = set()
        for char in string:
            if char in chars_set:
                return False
            else:
                chars_set.add(char)
        return True
Source by nbviewer.org #
 
PREVIOUS NEXT
Tagged: #unique #character
ADD COMMENT
Topic
Name
8+2 =