From ac61cc6a4490adfc91ff7b564588b25f2c860dde Mon Sep 17 00:00:00 2001 From: Dominique Liberda Date: Fri, 9 Dec 2022 13:48:10 +0100 Subject: [PATCH] + day 06, part 2 --- 06/02.sh | 13 +++++++++++++ 06/README.md | 8 ++++++++ 2 files changed, 21 insertions(+) create mode 100755 06/02.sh diff --git a/06/02.sh b/06/02.sh new file mode 100755 index 0000000..8e0eff8 --- /dev/null +++ b/06/02.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +x=() +i=0 +while read -n1 a; do + x=(${x[@]:0:13}) + x=($a ${x[@]}) + i=$((i+1)) + + [[ $(echo ${x[@]} | tr ' ' '\n' | sort | uniq | wc -l) == 14 ]] && break +done < /tmp/06 + +echo $i diff --git a/06/README.md b/06/README.md index df50890..17f9497 100644 --- a/06/README.md +++ b/06/README.md @@ -3,3 +3,11 @@ # part 1 *yawns* + +# part 2 + +*yaaawns* + +The only fun thing about this day was how I tackled the array compare :p + +supposedly day 7 is more interesting...