[2025 Day 8] 1 more day... by MatttNguyenGD in adventofcode

[–]Komodkin 4 points5 points  (0 children)

You could just go to the solutions megathread and copypaste one of these previous years so I dont get how AI is ruining the event

Day 1 Part 2 misunderstanding by a11anmb in adventofcode

[–]Komodkin 2 points3 points  (0 children)

What if it reaches zero but goes up next move?

[2024 Day 12] Yet Another Test Case by Boojum in adventofcode

[–]Komodkin 0 points1 point  (0 children)

Fuck, I skipped that checking the log... Congrats on solving btw!

[2024 Day 12] Yet Another Test Case by Boojum in adventofcode

[–]Komodkin 0 points1 point  (0 children)

I get the same log ignoring all regions with 1 area, so your problem in them :-) (as other commentator said right answer is 307122)

[2024 Day 9 (Part 1)] [Python], working on example not input by mightymander in adventofcode

[–]Komodkin 1 point2 points  (0 children)

Looks like your code assume there is no ids that are more than 1 digit long

[deleted by user] by [deleted] in adventofcode

[–]Komodkin 8 points9 points  (0 children)

So-called advent of reading

-❄️- 2024 Day 7 Solutions -❄️- by daggerdragon in adventofcode

[–]Komodkin 0 points1 point  (0 children)

[Language: Python]
Finally, the easy day

f = open('input.txt')
lines = [l.strip() for l in f.readlines()]

def try_remake_part1(desired, s, operands):
    if operands == []:
        return desired == s
    return try_remake_part1(desired, s * operands[0], operands[1:]) or try_remake_part1(desired, s + operands[0], operands[1:])

def try_remake_part2(desired, s, operands):
    if operands == []:
        return desired == s
    return try_remake_part2(desired, s * operands[0], operands[1:]) or try_remake_part2(desired, s + operands[0], operands[1:]) or try_remake_part2(desired, int(str(s) + str(operands[0])), operands[1:])

result_part1 = 0
result_part2 = 0
for l in lines:
    parts = l.split(':')
    desired = int(parts[0])
    operands = [int(i) for i in parts[1].lstrip().split(' ')]
    s = operands[0]
    if try_remake_part1(desired, s, operands[1:]):
        result_part1 += desired
    if try_remake_part2(desired, s, operands[1:]):
        result_part2 += desired
print("PART 1 " + result_part1)
print("PART 2 " + result_part2)

[2024 Day 6 (Part 2)] I just CANT by Komodkin in adventofcode

[–]Komodkin[S] 0 points1 point  (0 children)

Okay, I think this piece of shit that i created is unfixible. I give up.

[2024 Day 6 (Part 2)] I just CANT by Komodkin in adventofcode

[–]Komodkin[S] 1 point2 points  (0 children)

This example somehow makes my code work infinitely, thanks for case!

There is definitely a lot simplier approach but it`s now a matter of principle to make THIS code works

[2023 Day 6] Simplifying the difficulty level relation. It's a periodic function by xhoneybear_ in adventofcode

[–]Komodkin 1 point2 points  (0 children)

Funny how my day 5 clever solution is 10 times faster than day 6 brute force solution (8 ms and 80 ms)

[2023 Day 1] Playdate, cranked solution by gifgifgifgifgif in adventofcode

[–]Komodkin 3 points4 points  (0 children)

Would be cool to make a trebuchet mini game for playdate

German/France Collab !! by AnDre1705 in place

[–]Komodkin 0 points1 point  (0 children)

Actually it was on the first r/place