Discussion thread for day 14 of the Advent of Code : https://adventofcode.com/2020/day/14
Feel like I over complicated part 2 but it works...
Lots more binary
Here's me, a nice step down from yesterday's part 2 😅
Has anyone got a good way of doing "find nth" in a formula. I think part 2 could be simplified if there's an easy string manipulation way of doing "find nth" to search through Xs.
@Balders yep - did some dynamic regex to get a new version working. Less tools but slower than old version.
REGEX_Replace(
iif([Row-1:memory]="",[memory],[Row-1:memory]),
"^(.{" + ToString(Length(
REGEX_Replace(Mask,"(^([^X]*X){" + ToString(i) + "}[^X]*)X.*","$1")
)) + "})."
,"${1}" + Substring(PadLeft(IntToBin([P]),Count,"0"),I,1))
And used Regex CountMatches to work out how many I needed to run
@jdunkerley79 excellent
Not aiming for any golf points today...
the first part builds the regex for the replacements.
Part II - went iterative as I couldn't figure out how to replace all the potential 'X's.
Day14!
There are a lot of tools, but it's working well.
I have still yesterday's homework...(I don't clear the Day13 Part 2 by only Alteryx)
I struggled through part 2, but eventually got there. I think I can chalk it up to not reading the prompt thoroughly.
Parts 1 and 2.
Dan