Zulip Chat Archive

Stream: general

Topic: Advent Of Code 2025 - Day 3


Alfredo Moreira-Rosa (Dec 06 2025 at 17:37):

Here is my solution for Day 3.
I was lucky to make the algorithm generic since the beginning so it worked with the same code for part 2.

Solution

Alfredo Moreira-Rosa (Dec 06 2025 at 17:56):

The time complexity of the algorithm is O(n.m)O(n.m) where n is the max number of batteries to combine and m is the number of banks.

Jason Orendorff (Dec 13 2025 at 17:52):

https://github.com/jorendorff/advent-of-code/blob/main/2025/day03/Day03/Basic.lean

Solution

Alfredo Moreira-Rosa (Dec 13 2025 at 21:31):

Just in case you didn't know, there is native enumerate in lean : docs#List.zipIdx and docs#Array.zipIdx


Last updated: Dec 20 2025 at 21:32 UTC