Welcome to my Advent of Code 2025 journey! This repository contains my solutions to the daily coding challenges from Advent of Code, an annual event where programming and problem-solving meet the holiday spirit.
Advent of Code is a series of daily programming puzzles released every December leading up to Christmas. Each puzzle offers a fun challenge, a chance to learn, and an opportunity to showcase problem-solving skills.
Each day's solutions are organized into individual directories:
📂 DayXX/
├── DayXX_<ProblemTitle>.md # Problem solving approach
├── input.txt # Puzzle input (cached from AOC website after first run)
├── solution.py # My Solution (python file)
├── solution_ai.py # Vibe coded using AI to refactor & optimize my solution (Sometimes not so optimized)- Programming Language: Python 3.x
- Libraries:
requests- For fetching puzzle inputs from adventofcode.compython-dotenv- For managing environment variables securelypathlib- For cross-platform file path handling
git clone https://github.com/GKay-dev/Advent-Of-Code-2025.git
cd Advent-Of-Code-2025# Create virtual environment
python -m venv venv
# Activate virtual environment
# On Linux/Mac:
source venv/bin/activate
# On Windows:
venv\Scripts\activatepip install requests python-dotenv- Log in to Advent of Code
- Open browser DevTools (F12)
- Go to Application → Cookies →
https://adventofcode.com - Copy the value of the
sessioncookie
Create a .env file in the repository root:
AOC_SESSION=your_session_token_here
AOC_YEAR=event_year # AOC event year (event is happening since 2015)Important: Never commit your .env file! It's already included in .gitignore.
Navigate to a specific day's folder and run the solution:
cd DayXX # Replace XX with day number (01-12)
python solution.py
# or
python solution_ai.pyExecute all completed day solutions from the repository root:
python run_all.pyThis will:
- Run both
solution.pyandsolution_ai.pyfor each completed day - Display timing information for each solution
- Save all output to
AOC_2025_Output.txt - Configure the number of days to run by modifying
no_of_daysvariable inrun_all.py
On first run, the script will automatically:
- Fetch your puzzle input from adventofcode.com
- Cache it to
input.txtfor subsequent runs
- Automated Fetching: The
aoc_utils.pymodule automatically fetches puzzle inputs using your session token - Smart Caching: Inputs are cached locally to
input.txtto avoid unnecessary web requests - Flexible Options:
get_input(day=1)- Uses cache if available, otherwise fetches and savesget_input(day=1, force_fetch=True)- Always fetches from web, overwrites cacheget_input(day=1, save_to_file=False)- Fetches but never saves to file
- Performance Monitoring: The
timer_utils.pymodule provides decorators for timing function execution - Usage:
@timer(name="Part One") def Part_One(input_data): # Your solution code pass # Time both parts together for cleaner output time_both_parts(Part_One, Part_Two, input_data)
aoc_utils.py:
get_input(day, force_fetch=False, save_to_file=True)- Handles fetching and caching puzzle inputs
- Automatically creates day directories if needed
- Returns input as string
timer_utils.py:
@timer(name="Timer Name") # Decorator for timing individual functions (Timer name optional)
time_both_parts(func1, func2, *args) # Time two functions with same argumentsrun_all.py:
run_day(day_num) # Execute both solution files for a specific day
run_all_days(no_of_days) # Execute solutions for all days up to no_of_days- Automatically discovers and runs all solution files in each day's directory
- Captures and redirects output to
AOC_2025_Output.txt - Provides timing information for individual days and overall execution
aoc_utils.pycontains reusable utilities for fetching inputstimer_utils.pyprovides performance measurement toolsrun_all.pyorchestrates execution of all day solutions- Each solution file is self-contained and can run independently
- Environment variables are loaded automatically via
python-dotenv
solution.py: Original solution approach (No usage of AI in any manner)solution_ai.py: AI-optimized version with improved algorithms and performance enhancements (Sometimes, not so optimized)
| Day | Part 1 | Part 2 |
|---|---|---|
| Day 1 | ✅ | ✅ |
| Day 2 | ✅ | ✅ |
| Day 3 | ✅ | ✅ |
| Day 4 | ✅ | ✅ |
| Day 5 | ✅ | ✅ |
| Day 6 | ✅ | ✅ |
| Day 7 | ✅ | ✅ |
| Day 8 | ✅ | ✅ |
| Day 9 | ✅ | ✅ |
| Day 10 | ✅ | ✅ |
| Day 11 | ✅ | ✅ |
| Day 12 | ✅ | ✅ |
Suggestions? Reach out via GitHub Issues.