AOC24 Repository
Overview
The AOC24 repository contains solutions for various programming challenges that appear to be inspired by the Advent of Code (AOC) events. Each solution is implemented in Java and organized by days (d1, d2, etc.) and corresponding parts (p1, p2). The challenges involve a mix of algorithmic problem-solving, data parsing, and computational tasks.
This repository is currently inactive, but it contains valuable examples of coding techniques, problem-solving strategies, and Java programming practices.
Repository Structure
The repository is organized as follows:
d1p1.java to d9p2.java: Solutions for challenges, indexed by day (d1 to d9) and part (p1 or p2).
template.java: A boilerplate template for creating new solutions.
.gitignore: Specifies files and directories to be excluded from version control (data/, .class files, etc.).
Each solution typically:
- Reads input from a corresponding file in the
data/ directory.
- Implements problem-specific logic.
- Prints the result and the execution time in microseconds.
Challenges Overview
Day 1
d1p1.java: Calculates the total distance between two sorted lists of integers.
d1p2.java: Computes a similarity metric using frequency counts of integers in two lists.
Day 2
d2p1.java: Validates monotonicity and bounded differences in a sequence of integers.
d2p2.java: Extends the validation by allowing single element removals to enforce conditions.
Day 3
d3p1.java: Parses and multiplies integer pairs from input strings using regex.
d3p2.java: Adds conditional logic to selectively apply the parsed multiplication.
Day 4
d4p1.java: Searches for the word "XMAS" in a 2D grid in various directions.
d4p2.java: Looks for patterns involving "[Redacted Person]" around the character "A" in a grid.
Day 5
d5p1.java: Validates page order based on rules and calculates a checksum.
d5p2.java: Similar logic as d5p1 with additional constraints.
Day 6
d6p1.java: Simulates guard movement on a grid and counts marked positions.
d6p2.java: Extends the simulation by brute-forcing alternative paths.
Day 7
d7p1.java: Uses recursion to calculate combinations that reach a target value.
Day 8
d8p1.java: Determines "antipodes" (mirrored positions) in a grid and counts valid positions.
d8p2.java: Refines antipode calculations while avoiding duplicates.
Day 9
d9p1.java: Simulates file compression and calculates a checksum.
d9p2.java: Implements a more complex file compression algorithm with additional constraints.
Prerequisites
- Java Development Kit (JDK): Ensure that JDK 8 or above is installed to compile and run the programs.
- Input Files: The solutions rely on input files located in the
data/ directory. These files are not included in the repository and must be created for the programs to function.
How to Use
-
Clone the repository:
git clone <repository-url>
cd AOC24
-
Compile and run a specific solution:
javac ./repos/AOC24/d1p1.java
java -cp ./repos/AOC24 d1p1
-
Provide the required input file in the data/ directory (e.g., data/d1.txt for d1p1.java).
Future Improvements
- Documentation: Add problem descriptions for each solution to make the repository self-explanatory.
- Input Files: Include sample input files to allow users to test the solutions.
- Optimization: Refactor and optimize existing code for better performance and readability.
- Unit Tests: Implement unit tests for each solution to ensure correctness.
License
This repository does not specify a license. For reuse or contributions, please contact the original creator.
Status
Inactive: No active development or maintenance is currently ongoing for this repository.