Re: Advent of Code Day 8

2025-12-16 Thread Bernice Southey
Greg Sabino Mullane wrote: > As I said, I'm trying to solve them in a single statement. Recursive CTEs, > CASE, and creative use of JSON can get you a long way. Here's my day 7, which > runs slow compared to other languages, but runs as a single SQL statement and > no plpgsql, and I think is a

Re: Advent of Code Day 8

2025-12-16 Thread Greg Sabino Mullane
On Tue, Dec 16, 2025 at 7:59 AM Bernice Southey wrote: > Greg Sabino Mullane wrote: > > What's so wrong with brute force? :) > Yeah, a few more days of AoC changed my mind. > Doing things in SQL and/or plpgsql definitely presents a lot of challenges, especially in comparison to a "regular" prog

Re: Advent of Code Day 8

2025-12-16 Thread Bernice Southey
Greg Sabino Mullane wrote: > What's so wrong with brute force? :) Yeah, a few more days of AoC changed my mind. > In case it helps, here is my solution: Thank you, this is very clever! I tried something similar, but with updating the circuit in my table on every loop. It ran a couple of minutes j

Re: Advent of Code Day 8

2025-12-15 Thread Greg Sabino Mullane
> Is anyone else doing AoC in postgres this year? > https://adventofcode.com/2025/day/8 I am doing it, or at least chipping away a little but on the weekends. This last weekend I got up to day 9. Most days I can solve with a single SQL statement. Day 8 was not one of those, so I fell back to plpgs

Advent of Code Day 8

2025-12-08 Thread Bernice Southey
Hi, Is anyone else doing AoC in postgres this year? I've solved today's part 1 and 2 with a brute force loop, but there must be better ways. If anyone found something clever in postgres, please give me a big hint. https://adventofcode.com/2025/day/8 Thanks, Bernice