Skip to content

Instantly share code, notes, and snippets.

@shaunhyp57
Last active July 13, 2020 05:40
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 shaunhyp57/b4c86b205fc56fba1836d03f7c05e8fb to your computer and use it in GitHub Desktop.
Save shaunhyp57/b4c86b205fc56fba1836d03f7c05e8fb to your computer and use it in GitHub Desktop.
Cracking the Coding Interview, 6th Ed., Chapter 1 Question 1: Is Unique - using no data structure, python solution
def no_ds_is_unique(input_string):
letters = 'abcdefghijklmnopqrstuvwxyz'
for c in input_string:
if c in letters:
letters = letters.replace(c, "")
else:
return False
return True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment