Skip to content

appinha/advent_of_code-2015

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌟 Advent of Code 2015 🎄

My solutions for Advent of Code 2015.

GitHub code size in bytes Number of lines of code Code language count GitHub top language GitHub last commit


Day 01 Day 02 Day 03 Day 04 Day 05 Day 06 Day 07 Day 08 Day 09 Day 10 Day 11 Day 12 Day 13 Day 14

(TODO: add final picture of AoC calendar)

🗣️ About

(TODO: write)

🌟 What is Advent of Code?

🚀 TLDR: an online event where a two-part programming puzzle is released each day from Dec 1st to the 25th.

Advent of Code is an online event created by Eric Wastl. In his words:

Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like. People use them as a speed contest, interview prep, company training, university coursework, practice problems, or to challenge each other.

Source: https://adventofcode.com/about

🎄 This year story for the puzzles

Santa was hoping for a white Christmas, but his weather machine's "snow" function is powered by stars, and he's fresh out! To save Christmas, he needs you to collect fifty stars by December 25th.

Collect stars by helping Santa solve puzzles. Two puzzles will be made available on each day in the Advent calendar; the second puzzle is unlocked when you complete the first. Each puzzle grants one star. Good luck!

📑 Contents

My solutions for the puzzles are available in the folder 📁 my_solutions and are organized into subfolders for each day of the event.

Inside each subfolder, the following files can be found:

  • input_test.txt - text file containing input from tests given in the puzzle.
  • input.txt - text file containing my personal input for the puzzle.
  • main.py - Python code for solving the puzzle.

🛠️ Usage

Solve puzzle for a certain day:

make day=01

Solve puzzle for a certain day and part:

make day=08 part=1
make day=08 part=2

Solve puzzle for testing input:

make test day=12
make test day=12 part=1

Create a new day folder from template:

make new day=02

🗓️ Table of puzzles

DAY PUZZLE TITLE PUZZLE SUMMARY
📁 01 Not Quite Lisp 📃 Input: a string of opening (up +1) and closing (down -1) parenthesis.
Part One: follow the directions (parenthesis) and find the right floor.
Part Two: find the position of the first character that causes entering the basement (floor -1).
📁 02 I Was Told There Would Be No Math 📃 Input: list of dimensions of present boxes.
Part One: find the total area of wrapping paper needed.
Part Two: find the total length of ribbon needed.
📁 03 Perfectly Spherical Houses in a Vacuum 📃 Input: a string of cardinal directions.
Part One: find how many houses receive at least one present.
Part Two: find how many houses receive at least one present.
📁 04 The Ideal Stocking Stuffer 📃 Input: a secret key.
Part One: find the lowest positive number (decimal) that, combined with the secret key, produces a MD5 hash that starts with five zeros.
Part Two: same as befor, but for six zeros.
📁 05 Doesn't He Have Intern-Elves For This? 📃 Input: a list of strings.
Part One: find how many strings are nice (according to given rules).
Part Two: same as before, but with different rules.
📁 06 Probably a Fire Hazard 📃 Input: instructions on how to display the ideal lighting configuration.
Part One: find how many lights are lit after following the instructions.
Part Two: find the total brightness of all lights combined after following the instructions.
📁 07 Some Assembly Required 📃 Input: instructions for assembling a circuit of wires and bitwise logic gates.
Part One: assemble the circuit by following the instructions to find signal provided to wire a.
Part Two: same as before, but overriding wire b's signal with part one's answer.
📁 08 Matchsticks 📃 Input: a file that contains a list of double-quoted string literals.
Part One: find the number of characters of code for string literals minus the number of characters in memory for the values of the strings in total for the entire file.
Part Two: find the total number of characters to represent the newly encoded strings minus the number of characters of code in each original string literal.
📁 09 All in a Single Night 📃 Input: a list of distances between locations.
Part One: find the distance of the shortest route for visiting each location once.
Part Two: find the distance of the longest route for visiting each location once.
📁 10 Elves Look, Elves Say 📃 Input: a short sequence of digits.
Part One: starting with the digits from the puzzle input, apply the look-and-say sequence 40 times to find the length of the result.
Part Two: now for 50 times.
📁 11 Corporate Policy 📃 Input: a password (a string of 8 lowercase characters).
Part One: given Santa's method and Security-Elf requirements, find the next password.
Part Two: find the next password for the password found in part one.
📁 12 JSAbacusFramework.io 📃 Input: a json document containing arrays, objects, numbers, and strings.
Part One: find all of the numbers throughout the document and add them together.
Part Two: same as before, but ignoring any object (and all of its children) which has any property with the value "red".
📁 13 Knights of the Dinner Table 📃 Input: a guest list detailing the amount their happiness would increase or decrease depending on who sits next to them.
Part One: find the total change in happiness for the optimal seating arrangement, i.e. where maximum happiness is achieved.
Part Two: same as before, but adding a neutral guest to the table.
📁 14 Reindeer Olympics 📃 Input: descriptions of reindeers' flying patterns.
Part One: find what distance the winning reindeer traveled after 2503 seconds.
Part Two: find total points of winning reindeer after traveling for 2503 seconds.