Skip to content

Instantly share code, notes, and snippets.

@mudspringhiker
Created October 29, 2018 18:53
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 mudspringhiker/47ee85034ffee2d8eed5c0331e9d5f48 to your computer and use it in GitHub Desktop.
Save mudspringhiker/47ee85034ffee2d8eed5c0331e9d5f48 to your computer and use it in GitHub Desktop.
Practice Coding 1
# Implememt an algorithm to determine if a string has all unique characters. What if you cannot use additional data structures?
def isUnique(str):
if len(str) > 128:
retun False
char_set = []
for char in str:
if char in char_set:
return False
char_set.append(char)
return True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment