Advertisement
SadBunny

AoC 2022 day 1 parts 1+2

Nov 30th, 2022
351
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.16 KB | Source Code | 0 0
  1. awk '{i+=$0; if (!$0){print i; i=0;}}' < input | sort -rn | head -1
  2. awk '{i+=$0; if (!$0){print i; i=0;}}' < input | sort -rn | head -3 | awk '{i+=$0} END{print i}'
Tags: AoC2022
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement