Skip to content

emrergin/advent-of-code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advent Of Code Solutions

Advent of Code Solutions, done using Javascript. Written to be run by Nodejs.

What I learned

  • Number.MIN_SAFE_INTEGER can be used as a starting point for finding maximum of a set, instead of -Infinity.
  • Array.fill passes the objects with reference.
  • Number has a convenient EPSILON property.
  • Even the "BigInt" literal type has an upper bound, albeit not specified anywhere. Differently from "Number", if one overshoots the bound, they don't end up with Infinity, instead it is truncated.
  • One must try to manipulate the data using least common multiples dealing with huge numbers.
  • Set.delete() does not return the set, it returns a boolean.
  • I used this challenge to learn Java! Check out: https://github.com/emrergin/advent-of-code/tree/main/2018
  • While typing my custom Heap structure, I realized that intersection types do not override duplicate property types, instead require them to be compatible.
  • 2023 day 17 includes my first implementation of A-star algorithm. I implemented Dijkstra before, here, but not for graphs with arbitrary constraints.

Influences

  • I had to skim through solutions of others once, in Day 7, Part 2, 2019. While doing so, I found the following repo really useful: https://github.com/romellem/advent-of-code.
  • Brian Bucklew was the one that suggested me to check this website out. He also nudged me to the correct direction more than once.