Discussion thread for day 1 of the Advent of Code - https://adventofcode.com/2024/day/1
A nice start to advent of code 2024 - I'm sure there is much madness yet to come :D
Solved with "help" from my 5yo son this morning, who really wants me to help the elves save Christmas!
My solution attached:
I've defined List 1 and List 2 using the Formula tool:
List 1 = ToNumber(Regex_replace([data], "(\d+) +(\d+)", "$1"))
List 2 = ToNumber(Regex_replace([data], "(\d+) +(\d+)", "$2"))
Here the \d characters represent any numeric character, and I'm asking for 1 or more of that pattern. I use two capture groups, by encasing the numeric character patterns in round brackets. The " +" pattern represents 1 or more spaces, and since this is not in a capture group then this part of the string is ignored. The Regex_Replace function allows you to reference the capture groups by number using the "$" notation.
Day 1 is not so harsh to me.
in "text to column" set config as "Drop extra column with warning" and "skip emtpy column" will trim the extra space. while default is not.
Solved.
first challenge