All AoC 2024 solutions.
This is the new CBL repo with the revised AoC code 2024. I've added a few solution variants to my code based on discussions and some very clever ideas on Reddit - thanks to Eric and everyone else for this year!
(This is a new GitHub account, AoC 2024 has been done as 'Rowlf'.)
Characterise problems and solutions in terms of programming language features and algorithmic requirements, with a view to learning a new language.
All solutions involve reading data from a text file 'input.txt' and string manipulation. More typical ingredients are (data) classes to model small pieces of data with some properties, and typical collections such as lists/arrays, sets and maps. Tasks with 2D grid data use 2D arrays and, if modelled with classes, may also use indexes and operators.
- data '3 4'
- extract numbers, string manipulation, maybe regular expressions
- easy
- data '7 6 4 2 1'
- lists
- easy
- data 'xmul(2,4)%&mul[3,7]!@^do_not_mul(5,5)+mul(32,64]then(mul(11,8)mul(8,5))'
- regular expressions
- easy
- grid data 'MMMSXXMASM'
- (2d)arrays, classes, index-manipulations
- easy
- data '47|53 // 97|13 // 75,47,61,53,29'
- maps
- easy
- grid data '....#.....'
- (2d)arrays, index-manipulations, math (graph)
- easy/medium
- data '190: 10 19'
- classes, enums
- easy/medium (idea)
- grid data '........A...'
- (2d)arrays, index-manipulations
- easy
- data '2333133121414131402'
- classes
- easy/medium (complexity)
- grid data '...2... // 6543456'
- (2d)arrays, index-manipulations, math (graph)
- easy
- data '0 1 10 99 999'
- maps
- easy
- grid data 'AAAA // BBCD'
- (2d)arrays, index-manipulations, classes, math (graph)
- medium (part 1)/hard (part 2)
- data 'Button B: X+22, Y+67 // Prize: X=8400, Y=5400'
- classes, math (lin.algebra)
- easy
- data 'p=0,4 v=3,-3'
- (2d)arrays, index-manipulations, classes
- medium (complexity)
- grid data '##@.O..#'
- (2d)arrays, index-manipulations
- hard (complexity)
- grid data '#.#.###.#.###.#'
- (2d)arrays, index-manipulations, math (graph)
- medium (graph)
- data 'Register C: 0 // Program: 0,1,5,4,3,0'
- classes, long numbers
- easy/medium
- data '5,4 // 4,2'
- math (graph)
- medium (idea)
- data 'r, wr, b, g, bwu, rb, gb, br // brwrr'
- algo (dynamic programming)
- medium/hard (idea)
- grid data '#.#.#.#.#.###.#'
- (2d)arrays, index-manipulations, math (graph)
- medium/hard
- data '029A // 980A'
- algo (dynamic programming)
- hard (idea)
- data '1 // 10 // 100 // 2024'
- maps, long numbers
- medium (task description)
- data 'kh-tc // qp-kh'
- maps, math (graph)
- medium/hard (graph)
- data 'y02: 0 // x00 AND y00 -> z00'
- maps, classes
- easy (part 1), devil (part 2, idea)
- grid data '.#.#.'
- maps
- easy