Skip to content

Instantly share code, notes, and snippets.

@jackson-rz
Created July 18, 2014 21:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jackson-rz/b95c10cd3e7c5f9c068d to your computer and use it in GitHub Desktop.
Save jackson-rz/b95c10cd3e7c5f9c068d to your computer and use it in GitHub Desktop.
class Solution(object):
def uniquechar(self, string):
if string == '':
return True
string = sorted(string)
prev = string[0]
for char in string[1:]:
if char == prev:
return False
prev = char
else:
return True
s = Solution()
print s.uniquechar("q")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment