day1.1 (404B)
- #!/bin/sh
- # SPDX-FileCopyrightText: 2022 Haelwenn (lanodan) Monnier <contact+adventofcode@hacktivis.me>
- # SPDX-License-Identifier: BSD-3-Clause
- # Find the top three Elves carrying the most Calories. How many Calories are those Elves carrying in total?
- awk 'BEGIN { sum = 0 } { if(/^$/){ print sum; sum = 0 } else { sum += $1 } } END { print sum }' | sort -n | tail -3 | awk '{ i += $1 } END { print i }'