Skip to content

anish-107/advent-of-code-2024

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advent of Code 2024 🎄✨

Welcome to my Advent of Code 2024 repository! This repository contains my solutions for the Advent of Code puzzles, organized by day. Each day, two puzzles are released, and the goal is to solve them to collect stars ⭐.

Why Python?

I chose Python for solving these puzzles due to several reasons:

  • Ease of Use: Python’s syntax is simple and intuitive, allowing me to write clean and easy-to-understand code.
  • Rich Libraries: Python has a vast array of built-in libraries and data structures, which makes it easy to implement solutions for common problems.
  • Community Support: Python has a large, supportive community, providing a wealth of resources for problem-solving, debugging, and learning.
  • Quick Prototyping: Python allows me to quickly test and refine solutions, which is ideal for the fast-paced challenges of Advent of Code.

Repository Structure

Currently, the repository contains solutions for Day 1, Day 2 and Day 3, with the following structure:

.
├── Day 1
│   ├── input.txt      # The actual input provided by Advent of Code
│   ├── test.txt       # Example input provided in the problem description
│   ├── 1.py           # Solution for the first puzzle
│   ├── 2.py           # Solution for the second puzzle
│   └── problem.md     # The problem description in Markdown format
├── Day 2
│   ├── input.txt      # The actual input provided by Advent of Code
│   ├── test.txt       # Example input provided in the problem description
│   ├── 1.py           # Solution for the first puzzle
│   ├── 2.py           # Solution for the second puzzle
│   └── problem.md     # The problem description in Markdown format
├── Day 3
│   ├── input.txt      # The actual input provided by Advent of Code
│   ├── test.txt       # Example input provided in the problem description
│   ├── 1.py           # Solution for the first puzzle
│   ├── 2.py           # Solution for the second puzzle
│   └── problem.md     # The problem description in Markdown format
└── README.md          # This file
└── LICENSE            # MIT LICENSE

How to Use

  1. Clone the repository:

    git clone https://github.com/your-username/advent-of-code-2024.git
    cd advent-of-code-2024
  2. Navigate to a day's folder (e.g., Day 1 or Day 2 or Day 3):

    cd Day1  # or cd Day2 or cd Day3
  3. Run the solution scripts:

    • For the first puzzle:
      python 1.py
    • For the second puzzle:
      python 2.py

Files Description for each directory

  • input.txt: The input data used to solve the puzzle, provided by Advent of Code.
  • test.txt: Example input used for testing, based on the problem statement.
  • 1.py: Python script containing the solution to the first puzzle.
  • 2.py: Python script containing the solution to the second puzzle.
  • problem.md: The problem description copied from the Advent of Code website for easy reference.

Solutions Overview

Day 1: Historian Hysteria

  • Part 1: Calculate the total distance between two lists by pairing the smallest numbers.
  • Part 2: Calculate a similarity score by counting occurrences of each number.

For detailed explanations and solutions, check the problem.md file inside the Day1 directory.

Day 2: Red-Nosed Reports

  • Part 1: Determine the number of safe reports where levels are either all increasing or all decreasing, with differences of 1 to 3 between adjacent levels.
  • Part 2: Use the Problem Dampener, allowing one bad level to be ignored if removing it makes the report safe.

For detailed explanations and solutions, check the problem.md file inside the Day2 directory.

Day 3: Mull It Over

  • Part 1: Find and sum valid mul(X,Y) instructions from corrupted memory.
  • Part 2: Handle do() to enable and don't() to disable mul() instructions, summing only the enabled results.

Check the problem.md file in the Day3 directory for details.

Private Leaderboard Information

  • Leaderboard ID: 4310851-dea89f22
  • Leaderboard Name: Advent of Code 2024

You can join the leaderboard using the private link provided in your Advent of Code profile.

Contributing

Feel free to fork this repository and submit pull requests if you have improvements or alternative solutions!

Contact Information

If you have any questions, comments, or suggestions, feel free to reach out to me:

License

This project is open-source and available under the MIT License.


Happy coding and Merry Christmas! 🎅🎄✨

My GitHub Repo

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages