From c6d46650a6a7d5b20598038bc076d87b79624ca7 Mon Sep 17 00:00:00 2001 From: romangraef Date: Mon, 3 Dec 2018 20:16:13 +0100 Subject: more docs day3 --- day2/README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 day2/README.md (limited to 'day2/README.md') 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. -- cgit