Created
October 29, 2018 18:53
-
-
Save mudspringhiker/47ee85034ffee2d8eed5c0331e9d5f48 to your computer and use it in GitHub Desktop.
Practice Coding 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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