home.social

#aoc2025day2 — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #aoc2025day2, aggregated by home.social.

fetched live
  1. I've completed "Gift Shop" - Day 2 - Advent of Code 2025 #aoc2025 #AdventOfCode adventofcode.com/2025/day/2

    For #aoc2025day2 I am glad that I managed to put my thoughts into code on my own, but soon realized with larger datasets I would have a polynomial problem in this brute force approach.
    With #patterngenerator & #intervalllookup I achieved 30 times the calculation speed, done by AI Pair Programming, which helped me a lot in understanding the task.

  2. CW: Spoiler Advent of Code Day 2

    Day 2: Gift Shop

    Note: If you’re attempting to read this as a Fediverse post, you might find it rather confusing. I recommend using a web browser to read it properly, following this link.

    The challenge

    We were given a comma separated list of number pairs, the pairs being separated by dashes, like 1000-1020. These were to be read as ranges of numbers like 1000, 1001, 1002, … , 1020.

    The task is to sum up all the numbers which are composed of two identical halves. In this case, this would be just 1010.

    The idea

    In this case, a real idea isn’t needed. We just split the list of number pairs, which is given in a single line along the commas, then separate the pair, loop from the first number to the last and check whether the first half taken twice is the number as a whole. If so, we add the number to our sum.

    So, this is the code:

    Find the actual code at codeberg.org/M1na/AOC25/src/br

    The updated challenge

    We now don’t only look at numbers made up of equal halves, but also at those made up of any number of repetitions, like 121212 (3 times 12) or 99999 (5 times 9).

    The updated idea

    For any given number with the length l we check, if the whole number is made up from sections with lengths from 1 to l/2.

    Here is the code:

    Find the actual code at codeberg.org/M1na/AOC25/src/br

    #adventofcode #aoc2025 #aoc2025day2

  3. CW: Spoiler Advent of Code Day 2

    Day 2: Gift Shop

    Note: If you’re attempting to read this as a Fediverse post, you might find it rather confusing. I recommend using a web browser to read it properly, following this link.

    The challenge

    We were given a comma separated list of number pairs, the pairs being separated by dashes, like 1000-1020. These were to be read as ranges of numbers like 1000, 1001, 1002, … , 1020.

    The task is to sum up all the numbers which are composed of two identical halves. In this case, this would be just 1010.

    The idea

    In this case, a real idea isn’t needed. We just split the list of number pairs, which is given in a single line along the commas, then separate the pair, loop from the first number to the last and check whether the first half taken twice is the number as a whole. If so, we add the number to our sum.

    So, this is the code:

    Find the actual code at codeberg.org/M1na/AOC25/src/br

    The updated challenge

    We now don’t only look at numbers made up of equal halves, but also at those made up of any number of repetitions, like 121212 (3 times 12) or 99999 (5 times 9).

    The updated idea

    For any given number with the length l we check, if the whole number is made up from sections with lengths from 1 to l/2.

    Here is the code:

    Find the actual code at codeberg.org/M1na/AOC25/src/br

    #adventofcode #aoc2025 #aoc2025day2

  4. CW: Advent of Code

    I think this one was tricky to do efficiently in Ivy. I don't think any of the iteration options can do tail calls, and there are a lot of "early exit", and caching options

    #AdventOfCode #APL #aoc2025day2 #tech

  5. CW: Advent of Code

    I think this one was tricky to do efficiently in Ivy. I don't think any of the iteration options can do tail calls, and there are a lot of "early exit", and caching options

    #AdventOfCode #APL #aoc2025day2 #tech