Advent-of-Code-2023/day21/notes.org

1.4 KiB

Notes

part 1

so we aren't looking for minimal distance. but all plots which are end to any path of length 'steps left'

so, i have to follow all possible paths to the end? or. length of 6 and all even - because i could be doing <- -> but i could be doing loop around that would increase path len by odd number

let's just make direct recursive thing. create set of all reachable by n,

oh, the part 2.

i suppose this 'infinite' garden could be managed with my 'neighbors' work with 'out of field' fairly easy but what about sizes of the maps? are we releasing maps of previous iterations?

maybe if i directly pass references to prev and current, and manually set 'prev' to target new it will be collected?

and then elements after these steps <em>26501365</em> would fit into memory?

i guess maybe it would help if i had 'fully saturated' field

as my minimal 'skipping' thing

so. store FieldCoord(fieldRow, fieldCol) for fields which were fully saturated at current step.

filter out neighbors, no need to enter fully saturated fields

when counting on odd - around the S, on even - with S

but the neighboring fields would potentially (likely?) be in different phases

but i guess they are necessarily in different phases? or. if width odd - necessarily if width even - then what?

then S is not in the center

my input is 131 chars of width. so neighboring are necessarily of different phase. could compute phase of (0,0) and adjust from that