aboutsummaryrefslogtreecommitdiff
path: root/day2/README.md
diff options
context:
space:
mode:
authorromangraef <romangraef@loves.dicksinhisan.us>2018-12-03 20:16:13 +0100
committerromangraef <romangraef@loves.dicksinhisan.us>2018-12-03 20:16:13 +0100
commitc6d46650a6a7d5b20598038bc076d87b79624ca7 (patch)
tree2044ada00661a903b42eb926f8610c8d47f47ff3 /day2/README.md
parent8b654aa752efa50c9407dbe4fd8ed567dafbeb45 (diff)
downloadaoc2018-c6d46650a6a7d5b20598038bc076d87b79624ca7.tar.gz
aoc2018-c6d46650a6a7d5b20598038bc076d87b79624ca7.tar.bz2
aoc2018-c6d46650a6a7d5b20598038bc076d87b79624ca7.zip
more docs day3
Diffstat (limited to 'day2/README.md')
-rw-r--r--day2/README.md14
1 files changed, 14 insertions, 0 deletions
diff --git a/day2/README.md b/day2/README.md
new file mode 100644
index 0000000..2c3ea31
--- /dev/null
+++ b/day2/README.md
@@ -0,0 +1,14 @@
+## Day 2
+
+### Part One
+For this part i made use of a python standardlib functionality. You can
+use a `Counter("")` to count all chars with the string in a dict-like
+type. In the next step we just `sum()` a list comprehension which
+filters for either 2 or 3. Lastly we multiply both to find the
+checksum.
+
+### Part Two
+For this i settled for a simple for loop. The two interesting parts are
+that we first ignore identical IDs since we don't want to compare the
+same element to itself and we transform the strings into lists, since we
+can not subindexes on strings.