3 # read the file straight in for gits and shiggles
5 read -a data -d $'\0' < input.txt
7 echo "Got ${#data[*]} records"
9 for a in $(seq 0 $((${#data[*]}-2))); do
10 for b in $(seq $((a+1)) $((${#data[*]}-1))); do
11 if [ $((${data[$a]} + ${data[$b]})) -eq 2020 ]; then
12 echo "Match found: ${data[$a]} + ${data[$b]} = 2020"
13 echo "Multiplied: $((${data[$a]} * ${data[$b]}))"