Code is written in C# and .NET 6 mostly as an opportunity to newer language features (e.g. pattern matching, tuple types).
Mon | Tue | Wed | Thu | Fri | Sat | Sun |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- Day 1: DescendingComparer
- Day 1: ArraySegment use and array split using predicate
- Day 1: A note about SortedList and unique key requirements
- Day 2: File.ReadLines instead of File.ReadAllLines
- Day 3: Singe-variable bitmap to track rucksack items
- Day 4: Numberic interval operations
- Day 6: Unique character counting using bitmask resulting in 20x performance improvement over LINQ usage
- Day 9: 20x faster by using HashSet.UnionWith
- Day 11: ICloneable, list cloning to prevent double file reading
- Day 12: Parsing into array that has 1-element border on all sides to make finding neighbors easier
- Day 12: BFS path-finding from one origin to other destinations
- Day 13: Parsing expressions, accounting for nesting levels
- Day 13: IsDigit vs char.IsDigit
- Day 15: Interval merge algorithm
- Day 15: Parallel.ForEach and ConcurrentQueue for faster execution
- Day 15: Manhattan distance between points
- Day 16: Dijkstra algorithm to find shortest times needed from source to all other valves
- Day 16: Use of .NET's PriorityQueue
- Day 17: Finding a pattern in array of numbers
- Day 18: Expanding a 3D shape by 1, filling voids by exploring spaces between
- Day 18: int-based X/Y/Z-coordinates for faster searching
- Day 19: Searching for best solution using specified costs
- Day 20: Modulus function for negative numbers
- Day 20: Moving array element from one position to another while shifting others
- Day 21: Evaluating expression represented in binary tree
- Day 21: Reversing a path in binary tree to find needed value
- Day 23: Parallel.ForEach for 75% faster execution
- Day 24: 50x faster by pre-calculating blizzard locations
- Day 24: .NET PriorityQueue and A* algorithm to find best parh to single destination
- Performance Timing