tvl-depot/scratch/facebook/leetcode.org
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

6.7 KiB

Graph

TODO Alien Dictionary (Leetcode Premium)

TODO Graph Valid Tree (Leetcode Premium)

DONE Number of Connected Components in an Undirected Graph (Leetcode Premium)

Interval