Why Nostr? What is Njump?
2023-12-11 19:35:28

Virgile Andreani on Nostr: I really enjoy all of the potential optimizations that today's problem lends itself ...

I really enjoy all of the potential optimizations that today's problem lends itself to! One can compute all pair distances without even enumerating the pairs, one can also decouple x and y. I wonder what the optimal complexity might be. I think I am currently at O(n log n) with n = number of galaxies, but I have the feeling I could refactor my code in O(n) (which would be optimal, because it's bounded by the size of the input), if I am not mistaken…

#AdventOfCode
Author Public Key
npub1cuzpt4axlhncy27cv7r62y86cjlfvpwhdlvw4rcj8pzfsslc9mcs38q8lt