Skip to content

Instantly share code, notes, and snippets.

@mattk42
Last active December 2, 2020 23:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattk42/6d25a427344ea84270d0bafc5d87f7ff to your computer and use it in GitHub Desktop.
Save mattk42/6d25a427344ea84270d0bafc5d87f7ff to your computer and use it in GitHub Desktop.
#!/bin/bash
inputs="$(<$1)"
while read i
do
inputs="`echo "$inputs" | sed 1d`"
while read x
do
sum=$(($x + $i))
if [ $sum -eq 2020 ]
then
echo $(($x *$i))
fi
done <<< $inputs
done <<< $inputs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment