aoc-2022/06/01.sh

14 lines
186 B
Bash
Executable file

#!/bin/bash
x=()
i=0
while read -n1 a; do
x=(${x[@]:0:3})
x=($a ${x[@]})
i=$((i+1))
[[ $(echo ${x[@]} | tr ' ' '\n' | sort | uniq | wc -l) == 4 ]] && break
done < /tmp/06
echo $i