Added solutions

This commit is contained in:
Clement Chiew
2024-12-03 10:14:09 +08:00
parent c344a2d05e
commit 7fd2536a85
8 changed files with 2143 additions and 0 deletions

8
2024/day-1/solution-2.sh Normal file
View 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