about summary refs log tree commit diff
path: root/aoc/2022/01/part-two.sh
blob: a5a4d775113e0350b8f7c31766a7fc8e2fa2a0a8 (plain) (blame)
1
2
3
#!/bin/sh
sed 's/$/+/' | { echo 0; sed 's/^+$/p0/'; echo p; } | dc |
  sort -n | tail -n 3 | { echo 0; sed 's/$/+/'; echo p; } | dc