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)
```
|
||
|---|---|---|
| .. | ||
| advent-of-code-2019 | ||
| crack_the_coding_interview | ||
| data_structures_and_algorithms | ||
| deepmind | ||
| groceries | ||
| haskell-programming-from-first-principles | ||
| README.md | ||
Scratch
The purpose of the scratch directory is to host practice exercises. Practice
encompasses things like working on data structures and algorithms problems for
upcoming coding interviews or general aptitude as well as writing code snippets
to help me learn a new programming language or understand an unfamiliar concept.