appinha / advent_of_code-2015

My solutions for Advent of Code 2015 πŸŒŸπŸŽ„

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🌟 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

About Β· What is Advent of Code? Β· Contents Β· Usage Β· Table of puzzles


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.

About

My solutions for Advent of Code 2015 πŸŒŸπŸŽ„


Languages

Language:Python 99.0%Language:Makefile 1.0%