Skip to content

Instantly share code, notes, and snippets.

@samwarnick
samwarnick / fuzzySearch.py
Created March 24, 2016 16:35
a simple fuzzy search algorithm from an interview
fruit = ["watermelon", "apple", "oranges", "bannana"]
def fuzzySearch(words, term):
results = []
if len(term) == 0:
return results
termLength = len(term)
for word in words:
def recurse(r, c, dishes):
dishes[r][c] = " "
# bottom
if r < len(dishes)-1 and dishes[r+1][c] == "#":
recurse(r+1, c, dishes)
# top
if r > 0 and dishes[r-1][c] == "#":
recurse(r-1, c, dishes)
# right
if c < 9 and dishes[r][c+1] == "#":

Keybase proof

I hereby claim:

  • I am samwarnick on github.
  • I am samwarnick (https://keybase.io/samwarnick) on keybase.
  • I have a public key whose fingerprint is 832B 1123 1466 F2AF 09CC 2BA1 C976 F5BC F57A 5870

To claim this, I am signing this object: