diff options
Diffstat (limited to 'password-philosophy/README.org')
-rw-r--r-- | password-philosophy/README.org | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/password-philosophy/README.org b/password-philosophy/README.org new file mode 100644 index 0000000..2ceb22c --- /dev/null +++ b/password-philosophy/README.org @@ -0,0 +1,33 @@ +See: https://adventofcode.com/2020/day/2 +** Part 1 +*** Purpose +Given a list of passwords and their supposed requirements + +#+begin_example +1-3 a: abcde +1-3 b: cdefg +2-9 c: ccccccccc +#+end_example + +Return the amount of valid passwords. Password one requires 1-3 'a' characters. Password 2 is invalid. + +*** Method +Simply parse each input and store them in... Well, let's do a list: + +#+begin_example +(passwd char (min max)) +#+end_example + +Then, create a function count occurances of CHAR in PASSWD, and see how it compares to RANGE. + +** Part 2 +*** Purpose +The password verification method has changed: + +#+begin_example +1-3 a: abcde +1-3 b: cdefg +2-9 c: ccccccccc +#+end_example + +Now, the "range" corresponds to two indices (indexed from 1). Of these indices, exactly one needs to be the given CHAR. |