Added solutions
This commit is contained in:
8
2024/day-1/solution-2.sh
Normal file
8
2024/day-1/solution-2.sh
Normal file
@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
join -1 2 -2 2 \
|
||||
<( awk '{print $2}' input.txt | sort -n | uniq -c ) \
|
||||
<( awk '{print $1}' input.txt | sort -n | uniq -c ) |
|
||||
awk '{print $1 * $2 * $3 }' |
|
||||
paste -s -d "+" |
|
||||
bc
|
Reference in New Issue
Block a user