Skip to content

Advent of Code is an annual set of Christmas-themed computer programming challenges that follow an Advent calendar.

License

Notifications You must be signed in to change notification settings

jabrena/advent-of-code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advent of code collection

Advent of Code is an annual set of Christmas-themed computer programming challenges that follow an Advent calendar.

Java CI

SonarQube Cloud

Cloud IDEs

Open in GitHub Codespaces

Open in Gitpod

Benefits solving AOC problems

  • Improve Java programming skills: Master modern Java features (Java 25), SOLID principles, Effective Java best practices, and clean code techniques

  • Functional Programming & Design:

  • Data Oriented Programming (DOP):

    • Code-Data Separation: Instructions as data structures, execution logic separated from instruction representation
      • Instruction sealed interface separates instruction data from execution logic
      • Instruction for Turing machine instructions
    • Generic Data Structures: Flexible, reusable data representations
    • Immutable Data: Records and sealed interfaces ensure data integrity
    • Pure Data Manipulation: Transformations through pure functions, explicit data flow
    • Flat Data Models: Denormalized structures for efficient processing
    • Interleaved Arrays: Better cache locality for related data pairs
  • Algorithms & Data Structures:

    • Graph Algorithms: BFS (Breadth-First Search), DFS (Depth-First Search), Dijkstra's shortest path, A* pathfinding with heuristics, memoized path counting (e.g., GraphPathCounter)
    • Dynamic Programming: Memoization for overlapping subproblems, optimal substructure exploitation (e.g., GraphPathCounter, BeamPathCounter)
    • Backtracking: Recursive search with pruning, constraint satisfaction (e.g., ShapePacking with bitmask optimization)
    • State Space Search: BFS/DFS for exploring solution spaces
    • Range Algorithms: Range merging, interval operations, coverage calculations (e.g., Range2, Interval)
    • Tree Traversal: File system navigation, hierarchical data processing
    • String Algorithms: Pattern matching, parsing, validation, hash generation
    • Grid Algorithms: 2D matrix manipulation, neighbor checking, cellular automata, pathfinding in grids (e.g., GridNeighbor2, BeamPathCounter)
    • Union-Find (DSU): Disjoint Set Union for connected components with path compression and union by size (e.g., DSU in PointCluster3)
    • Meet-in-the-Middle: Split-and-combine approach for exponential problems (e.g., Part1Solver with Gray Code optimization)
    • RREF (Reduced Row Echelon Form): Linear algebra for constraint optimization (e.g., RationalMatrix in Part2Solver)
    • Bitmask Optimization: Efficient 2D grid representation with O(1) bitwise operations (e.g., ShapePacking, ShapeVariant)
    • Primitive Collections: FastUtil and Eclipse Collections for performance-critical code (e.g., ObjectArrayList, LongIntHashMap)
    • Optimization Techniques: Big O analysis, complexity optimization, space-time tradeoffs, parallel execution
    • Virtual Machine Implementation: Instruction-based execution with state management
      • AssembunnyInterpreter with trampoline-based execution
      • Turing machine implementation with sealed instruction types

Testing & Benchmarking

  • Unit Testing: Comprehensive test coverage with JUnit 5
  • JMH Benchmarks: Performance benchmarking for algorithm comparison
    • Run benchmarks: ./mvnw clean test -Pbenchmarks -Dtest=DayXBenchmarkTest -D2025-dayX-benchmark=true -Dsurefire.failIfNoSpecifiedTests=false -pl 2025 -am
    • Available for Days 1, 2, 4, 5, 6, 8 (2025)
  • Java Flight Recorder: Profiling data included in benchmark results
  • Performance Analysis: See Big O Notation Documentation for complexity analysis

References

Acknowledgements

A heartfelt thanks to Frontier models for the insightful early morning (6:00 AM) discussions on design thinking and code refactoring, with a focus on functional approaches. I'm also deeply grateful to my friend Juan Antonio Medina for the continuous and inspiring conversations throughout the day, and to Rene van Putten for their invaluable inspiration.

About

Advent of Code is an annual set of Christmas-themed computer programming challenges that follow an Advent calendar.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors 3

  •  
  •  
  •