Skip to content

Commit 320e873

Browse files
committed
Added day 4 part 1
1 parent 5b70a65 commit 320e873

File tree

5 files changed

+21
-1
lines changed

5 files changed

+21
-1
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44

55
// project meta data
66
group 'de.havox_design.aoc2015'
7-
version '0.3.0'
7+
version '0.3.1'
88

99
// Switch to gradle "all" distribution.
1010
wrapper {

day04/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Day 4: The Ideal Stocking Stuffer
2+
Santa needs help [mining](https://en.wikipedia.org/wiki/Bitcoin#Mining) some AdventCoins (very similar to
3+
[bitcoins](https://en.wikipedia.org/wiki/Bitcoin)) to use as gifts for all the economically forward-thinking little
4+
girls and boys.
5+
6+
To do this, he needs to find [MD5](https://en.wikipedia.org/wiki/MD5) hashes which, in
7+
[hexadecimal](https://en.wikipedia.org/wiki/Hexadecimal), start with at least **five zeroes**. The input to the MD5
8+
hash is some secret key (your puzzle input, given below) followed by a number in decimal. To mine AdventCoins, you
9+
must find Santa the lowest positive number (no leading zeroes: `1`, `2`, `3`, ...) that produces such a hash.
10+
11+
For example:
12+
* If your secret key is `abcdef`, the answer is `609043`, because the MD5 hash of `abcdef609043` starts with five
13+
zeroes (`000001dbbfa...`), and it is the lowest such number to do so.
14+
* If your secret key is `pqrstuv`, the lowest number it combines with to make an MD5 hash starting with five zeroes
15+
is `1048970`; that is, the MD5 hash of `pqrstuv1048970` looks like `000006136ef...`.
16+
17+
Your puzzle input is `bgvyzdsv`.

day04/src/main/resources/day04.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bgvyzdsv
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
abcdef
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pqrstuv

0 commit comments

Comments
 (0)