tvl-depot/scratch/facebook
William Carroll 93d7b5d8ea Solve a few String questions
Valid Anagram

This one is a classic: `sorted(a) == sorted(b)`

Group Anagrams

Using product of prime numbers to create a key for anagrams is much faster than
sorting the characters in each word. It is also satisfyingly simple.

Encode and Decode Strings

My initial implementation was clumsy and prone to fail for edge-cases. A more
elegant solution is using something like:

```python
def encode(words):
  return "".join("{}:{}".format(len(x), x) for x in words)
```
2020-12-25 03:52:54 +00:00
..
hard Define another function to illustrate Reservoir Sampling 2020-12-07 20:10:50 +00:00
interview-cake Solve "cafe order checker" (again) 2020-11-21 16:31:53 +00:00
moderate Solve "find pairs for sum" 2020-11-16 17:12:05 +00:00
parsing Document subset of BNF for regex engine 2020-11-13 16:55:39 +00:00
recursion-and-dynamic-programming Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
anglocize-int.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
balanced-binary-tree.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
breakfast-generator.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
bst-checker.py Refactor existing bst-checker implementation 2020-11-21 14:14:50 +00:00
cafe-order-checker.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
cake_thief.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
camping-knapsack.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
coin.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
count-islands.py Update BFS impls 2020-11-23 23:21:20 +00:00
delete-node.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
dijkstras.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
edit-distance.py Implement the Levenstein "edit distance" algorithm 2020-11-20 21:59:18 +00:00
evaluator.hs Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
evaluator.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
find-duplicate-beast-mode.py Solve "find duplicate" using a graph 2020-11-21 13:35:05 +00:00
find-duplicate-optimize-for-space.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
find-rotation-point.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
find-unique-int-among-duplicates.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
graph-coloring.py Update BFS impls 2020-11-23 23:21:20 +00:00
heap.py Partially implement a Heap 2020-11-14 14:08:58 +00:00
highest-product-of-3.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
infix-to-postfix.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
inflight-entertainment.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
intersecting-linked-lists.py Find the intersection (if any) between two linked lists 2020-11-15 17:42:44 +00:00
knapsack-faq.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
kth-to-last-node-in-singly-linked-list.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
language.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
language2.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
largest-contiguous-sum.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
largest-stack.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
leetcode.org Solve a few String questions 2020-12-25 03:52:54 +00:00
linked-list-cycles.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
linked_list.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
london-knapsack.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
longest-common-substring.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
merge-sorted-arrays.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
merging-ranges.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
mesh-message.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
move-zeroes-to-end.py Add another solution to the "move zeroes to end" problem 2020-11-16 17:13:03 +00:00
mst.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
n-queens.py Solve N queens 2020-11-13 16:56:02 +00:00
nearby-words.py Solve "nearby words" function 2020-11-16 17:17:28 +00:00
node.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
nth-fibonacci.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
onsite.txt Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
permutation-palindrome.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
polynomial-rolling-hash.py Prefer mutative variant of delete for HashTable 2020-11-16 17:13:39 +00:00
product-of-all-other-numbers.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
queue-two-stacks.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
rabin-karp.py Implement the Rabin Karp string matching algorithm 2020-11-16 17:14:08 +00:00
recursive-string-permutations.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
reverse-linked-list.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
reverse-string-in-place.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
reverse-words.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
scratch.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
second-largest-item-in-bst.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
shuffle.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
stack.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
stacking-boxes.py Solve box-stacking problem 2020-11-13 16:57:47 +00:00
stock-price.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
todo.org Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
top-scores.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
topo-sort.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
traversals.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
utils.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00
word-cloud.py Add coding exercises for Facebook interviews 2020-11-12 14:37:29 +00:00