this post was submitted on 12 Dec 2023
9 points (100.0% liked)
Advent Of Code
764 readers
1 users here now
An unofficial home for the advent of code community on programming.dev!
Advent of Code is an annual Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like.
AoC 2023
Solution Threads
M | T | W | T | F | S | S |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 |
Rules/Guidelines
- Follow the programming.dev instance rules
- Keep all content related to advent of code in some way
- If what youre posting relates to a day, put in brackets the year and then day number in front of the post title (e.g. [2023 Day 10])
- When an event is running, keep solutions in the solution megathread to avoid the community getting spammed with posts
Relevant Communities
Relevant Links
Credits
Icon base by Lorc under CC BY 3.0 with modifications to add a gradient
console.log('Hello World')
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Thanks for the detailed explanation. It helped a lot, especially what the
tbl
actually holds.I've read your code again and I get how it works, but it still feels kinda strange that we are considering values outside of range of
a
andb
, and that we are marking them as correct. Like in first row of the example???.### 1,1,3
, there is no spring at8
and no group at3
but we are marking(8,3)
and(7,3)
as correct. In my mind, first position that should be marked as correct is4,2
, because that's where group of 3 can fit.If you make the recurrent case a little more complicated, you can sidestep the weird base cases, but I like reducing the endpoints down to things like this that are easily implementable, even if they sound a little weird at first.
You are probably right. Just my rumblings. Thanks for the help.