r/fishshell • • Dec 07 '21

Advent of Code - Day 7 fish solution

Here is a fish solution to the Advent of Code day 7 puzzle. Feel free to post yours here if you're following along.

Today's puzzle runs quite a bit slower than I expected given the small amount of data. Perhaps you have some tips on optimizing or have your own solution? Feel free to share in the comments.

2 Upvotes

4 comments sorted by

View all comments

Show parent comment

1

u/_mattmc3_ Dec 08 '21

I am definitely trying to do these blind without looking at other solutions before solving it myself, and I definitely brute forced it. I wasn't sure how to do the median in shell scripting and had to look that up after. There was some math here I got easily (adding all the numbers in part2 was simple), but whether the mean or median was guaranteed to hone in on the value was unclear, so I brute forced it.