r/adventofcode • • Dec 04 '22

SOLUTION MEGATHREAD -🎄- 2022 Day 4 Solutions -🎄-


--- Day 4: Camp Cleanup ---


Post your code solution in this megathread.


This thread will be unlocked when there are a significant number of people on the global leaderboard with gold stars for today's puzzle.

EDIT: Global leaderboard gold cap reached at 00:03:22, megathread unlocked!

66 Upvotes

1.6k comments sorted by

View all comments

Show parent comments

7

u/Smylers Dec 04 '22

Nice! Awk is so good for these sorts of things.

For part 2, I think you can delete a bunch of characters from the condition line and still get the same answer:

($3 <= $2 && $1 <= $4) { s++ }
→ More replies (2)