aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/2018/day4/aoc.cpp5
-rw-r--r--src/2019/day4/README.md17
-rw-r--r--src/2019/day4/aoc.h1
3 files changed, 18 insertions, 5 deletions
diff --git a/src/2018/day4/aoc.cpp b/src/2018/day4/aoc.cpp
index 811d5b5..6df496c 100644
--- a/src/2018/day4/aoc.cpp
+++ b/src/2018/day4/aoc.cpp
@@ -17,14 +17,10 @@ std::pair<int, int> mostlikely(guard* g) {
int most{INT32_MIN};
int highest{INT32_MIN};
for (int i = 0; i < 60; i++) {
- // printf("%02d ", minute[i]);
if (minute[i] > highest) {
most = i;
highest = minute[i];
}
- // if ((i + 1) % 10 == 0) {
- // printf("\n");
- //}
}
return {most, highest};
}
@@ -102,7 +98,6 @@ std::pair<int, int> day4(line_view file) {
for (auto& kv : hs) {
int off = totaloff(kv.second);
- // printf("%d: %d\n", kv.second->id, off);
if (mostoff.g == nullptr || mostoff.off < off) {
mostoff.g = kv.second;
mostoff.off = off;
diff --git a/src/2019/day4/README.md b/src/2019/day4/README.md
index e69de29..616ef85 100644
--- a/src/2019/day4/README.md
+++ b/src/2019/day4/README.md
@@ -0,0 +1,17 @@
+--- Day 4: Secure Container ---
+You arrive at the Venus fuel depot only to discover it's protected by a password. The Elves had written the password on a sticky note, but someone threw it out.
+
+However, they do remember a few key facts about the password:
+
+It is a six-digit number.
+The value is within the range given in your puzzle input.
+Two adjacent digits are the same (like 22 in 122345).
+Going from left to right, the digits never decrease; they only ever increase or stay the same (like 111123 or 135679).
+Other than the range rule, the following are true:
+
+111111 meets these criteria (double 11, never decreases).
+223450 does not meet these criteria (decreasing pair of digits 50).
+123789 does not meet these criteria (no double).
+How many different passwords within the range given in your puzzle input meet these criteria?
+
+
diff --git a/src/2019/day4/aoc.h b/src/2019/day4/aoc.h
index 959d6d8..56ffadb 100644
--- a/src/2019/day4/aoc.h
+++ b/src/2019/day4/aoc.h
@@ -3,4 +3,5 @@
namespace aoc2019 {
+int day4(line_view);
}