Skip to content
This repository has been archived by the owner on Jan 6, 2024. It is now read-only.

Latest commit

 

History

History
37 lines (27 loc) · 1.66 KB

README.md

File metadata and controls

37 lines (27 loc) · 1.66 KB

Note: deprecated.

See instead:

Learnings

See also:

Python

  • Use defaultdict(int) to count elements:
    • d = defaultdict(int) # then d[k] += 1, values default to zero
    • beware, in a defaultdict even a read can invalidate iterators
    • defaultdict(bool) might be useful too, but a set() might be better
  • There are useful implementations in Python's itertools doc: https://docs.python.org/3/library/itertools.html (see "Itertools Recipes" section)

Maths & Algorithms

Haskell

  • concatMap f . g is g >=> f (see day 10)