I hereby claim:
- I am damzam on github.
- I am dmorton (https://keybase.io/dmorton) on keybase.
- I have a public key ASBL4_oC6IYBJBjG_3FhblZP1R0LDof0wjP6huHis6TnpQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
""" | |
Figure out the smallest sum for a binary lattice | |
of nodes where children are shared. | |
e.g. | |
1 | |
/ \ | |
4 5 | |
/ \ / \ |
#!/usr/bin/env python | |
""" | |
Create a superset from the integers provided | |
e.g. ./superset.py 1 2 3 | |
[set([]), set([1]), set([2]), set([3]), set([1, 2]), | |
set([1, 3]), set([2, 3]), set([1, 2, 3])] | |
""" | |
import sys |
#!/usr/bin/env python | |
""" | |
Find the right sibling in a Binary Tree that's not fully populated | |
e.g. | |
1 | |
/ \ | |
2 6 | |
/ \ \ |
#!/usr/bin/env python | |
""" | |
Python's OrderedDict is an ideal data structure | |
to create an LRU cache | |
""" | |
from collections import OrderedDict | |
class LRUCache(object): |
#!/usr/bin/env python | |
""" | |
encrypt and descript lowercase strings without using | |
but lowercase strings | |
""" | |
from string import lowercase | |
from random import choice | |
MAX_GARBAGE_LENGTH = 5 |
#!/usr/bin/env python | |
""" | |
A script to serialize and deserialize Binary Trees in Python | |
""" | |
class Node(object): | |
def __init__(self, val, left=None, right=None): | |
self.val = val | |
self.left = left |
#!/usr/bin/env python | |
""" | |
Given the start word and end word find one of the | |
shortest possible paths from one word to the other | |
that can be achieved by substituting a single | |
character (where each word in the path is a valid | |
English word) | |
Usage: |
#!/usr/bin/env python | |
""" | |
This is my solution to the Simple Database problem posted on: | |
http://www.thumbtack.com/challenges/software-engineer | |
Candidate: David Morton | |
Email: [email protected] | |
Usage: |
#!/usr/bin/env python | |
""" | |
A script that generates all possible words that can be formed from | |
the characters in a provided string. | |
Matches are case-insensitive and the wordlist used is obtained from: | |
https://raw.githubusercontent.com/mattt/mobius/master/data/english-wordlist | |
Usage: |