From 792d86423f048015c8294ade4a9f44850ef2f702 Mon Sep 17 00:00:00 2001 From: Clement Date: Wed, 11 Dec 2024 23:30:07 +0800 Subject: [PATCH] minor speedup --- 2024/day-11/solution-2-2.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2024/day-11/solution-2-2.sh b/2024/day-11/solution-2-2.sh index 8edb505..75828c3 100644 --- a/2024/day-11/solution-2-2.sh +++ b/2024/day-11/solution-2-2.sh @@ -98,7 +98,7 @@ do fi done < temp-input | tee temp-output | - sort -n | + sort -n -k2 | uniq -c | awk '{sums[$3] += $1 * $2 } END {for (i in sums) {print sums[i], i}}' | sponge temp-input