Skip Navigation

InitialsDiceBearhttps://github.com/dicebear/dicebearhttps://creativecommons.org/publicdomain/zero/1.0/„Initials” (https://github.com/dicebear/dicebear) by „DiceBear”, licensed under „CC0 1.0” (https://creativecommons.org/publicdomain/zero/1.0/)ST
Posts
0
Comments
2
Joined
2 yr. ago

  • Thanks! yup, I figured there would be a way. You're right, much faster, on my machine with your code, this is the speed:

     
        
    $ time python3 day7.py 
    4555081946288
    227921760109726
    
    real    0m0.171s
    
      

    I'll have to take a look to understand how that works to be better.

  • Python

    Takes ~5.3s on my machine to get both outputs. Not sure how to optimize it any further other than running the math in threads? Took me longer than it should have to realize a lot of unnecessary math could be cut if the running total becomes greater than the target while doing the math. Also very happy to see that none of the inputs caused the recursive function to hit Python's max stack depth.

    https://github.com/stevenviola/advent-of-code-2024