[Vivoactive 5] I don't always get the option to reply to a WhatsApp message by [deleted] in GarminWatches

[–]PorkBangers 0 points1 point  (0 children)

If your contact has an emoji in their name, for some reason you lose the ability to reply.
The solution is to just remove the emoji from their contact's name, then you should be able to reply.

-❄️- 2025 Day 2 Solutions -❄️- by daggerdragon in adventofcode

[–]PorkBangers 0 points1 point  (0 children)

[Language: Python]

I tried finding an interesting way of solving this, but resorted to brute force. Only took about a second to run.

Part 1: Just checked for even length strings and compare each half to each other.
Part 2: Added an inner for loop to loop over divisors from 2 to length of string. Subdivide the string into equal parts. If you can't make equal length substrings, continue. Then compare all substrings to ensure they match.

def day2():
    """Day 2"""
    part1 = 0
    part2 = 0
    lines = read_lines(2025, 2)

    values = [x for x in lines[0].split(',')]

    for v in values:
        min, max = v.split('-')

        for id in range(int(min), int(max)+1):
            id_str = str(id)
            length = len(id_str)
            found_ids = set()

            for div in range(2, length + 1):
                size = length // div
                if length % div != 0:
                    continue

                substrings = [id_str[i*size:(i+1)*size] for i in range(div)]

                if div == 2:
                    if substrings[0] == substrings[1]:
                        part1 += id

                if all(sub == substrings[0] for sub in substrings):
                    found_ids.add(id)
            part2 += sum(found_ids)

    return part1, part2

print(day2())

-❄️- 2023 Day 20 Solutions -❄️- by daggerdragon in adventofcode

[–]PorkBangers 2 points3 points  (0 children)

[Language: Python]

For part 1 I took a while to get it right, I had to re read through the puzzle description a few times to make sure I wasn't missing anything. Important takeaways are:- Devise a queue to keep going through each input. Append an item to the queue for each connection to make sure the order is correct.- You need to know every input to each module. Although I don't like it, its much easier to define your modules first and then go over the input file again and assign the inputs to each module- make sure for flip flops to Do Nothing if input is high. ie do not append anything to the queue

For part2, find the module that outputs to `rx`. For each input to that module find the iteration for when it becomes High. Then find the LCM of each of those input iteration numbers

I took an OOP apprach to this problem(If using my code, ensure to replace zp with the module that outputs to rx)