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

Solutions to & Learnings from Advent of Code 2015

Notifications You must be signed in to change notification settings

sroccaserra/aoc2015

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)