Skip to content

BobbyShaftoe/aoc-2024-java-edition

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advent of Code 2024

Lang

This Advent of Code attempt is written in Java 23.0.1

Overview

Here's my attempt at the Advent of Code 2024. I'm using Java 23.0.1, IntelliJ IDEA 2024 & Copilot (only for language help and boilerplate)

Overall, the main approach is functional programming as much as possible; i.e. the Streams API and other language features. My idea was also to leverage Java 21+ features at every opportunity, such as the new switch expressions and pattern matching.

Results!

D:\Lib\jdk-23.0.1\bin\java.exe --enable-preview 
"-javaagent:C:\Users\Kings\AppData\Local\Programs\IntelliJ IDEA Ultimate\..." 
  -Dfile.encoding=UTF-8 
  -classpath C:\Users\Kings\Documents\Projects\AoC\2024\aoc2024\target\classes... 
  Main

***************************
*** Advent of Code 2024 ***
***************************

Day 1: Historian Hysteria - Part 1

https://adventofcode.com/2024/day/1

  Day 1 (part 1): Historian Hysteria  
  The answer is total distance = 1579939

Day 1: Historian Hysteria - Part 2

  Day 1 (part 2): Historian Hysteria  
  The answer is total similarity score = 20351745


Day 2: Red-Nosed Reports - Part 1

https://adventofcode.com/2024/day/2

  Day 2 (part 1): Red-Nosed Reports
  The answer is total safe reports = 356

Day 2: Red-Nosed Reports - Part 2

  Day 2 (part 2): Red-Nosed Reports
  The answer is total adjusted safe reports = 413


Day 3: Mull It Over - Part 1

https://adventofcode.com/2024/day/3

  Day 3 (part 1): Mull It Over
  The answer is total sum of multiplications = 169021493

Day 3: Mull It Over - Part 2

  Day 3 (part 2): Mull It Over
  The answer is total sum of enabled multiplications = 111762583


Day 4: Ceres Search - Part 1

https://adventofcode.com/2024/day/4

  Day 4 (part 1): Ceres Search
  The answer is total occurrences of word = 2358


References

This is a bunch of references mostly about functional programming and using Streams API in Java 21+

Java Streams

Java solutions to AoC 2022

Miscellaneous references and notes

Errata

There's a good chance I will not complete all the days, but what days I do complete I will also replicate in separate projects based on Python and Go. This is to compare similar approaches to the same problems with different languages.

EOF

Releases

No releases published

Packages

No packages published

Languages