Rules: no spoilers.

The other rules are made up as we go along.

Share code by link to a forge, home page, pastebin (Eric Wastl has one here) or code section in a comment.

  • @zogwarg
    link
    English
    27 months ago
    discussion

    In retrospect that would have been far better for runtime, my dist function ended up being a tad expensive.

    I substituted the rows/columns, with multiplication by the expansion rate if they were all numbers. And then for each galaxy pair do a running sum by going “down” the “right” and adding the distance for each row and column crossed.

    https://github.com/zogwarg/advent-of-code/blob/main/2023/jq/11-b.jq

    transpose is nice to have in that approach.