>

Minimizing The Sum of Absolute Values -- Day 7 Advent of Code part 1 🎄

This year I took part in the advent of code event. If you’ve never heard about it, I attach tl;dr bellow. Today, I’d like to share my solution for Day 7 problem, because I find it very interesting. In the first half of the post I describe comparison in time complexity of two solutions (programming). In the second half I outline the proof of one solution (math). What is the Advent of Code For sure you had some kind of advent calendar in the past (or you still have), e.g. with little chocolates. You are supposed to eat one chocolate per day while counting days to Christmas Eve. AoC is an advent calendar for coders. Every day, a new programming task is revealed. You can compete to be high either in a global ranking (which is unreasonably difficult) or among your friends in a private ranking (that’s feasible, depending on your friends). ...

January 4, 2022