+ day 06, part 2
This commit is contained in:
parent
e73fd9a4c7
commit
ac61cc6a44
13
06/02.sh
Executable file
13
06/02.sh
Executable file
|
@ -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
|
|
@ -3,3 +3,11 @@
|
||||||
# part 1
|
# part 1
|
||||||
|
|
||||||
*yawns*
|
*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...
|
||||||
|
|
Loading…
Reference in a new issue