This commit is contained in:
2023-12-02 16:36:49 +01:00
parent 914adc63e6
commit db32ffa315
7 changed files with 173 additions and 61 deletions

1000
01/input.txt Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -71,10 +71,10 @@ func main() {
// find single digits in backward-replaced line
lastMatch := nRegex.FindAllStringSubmatch(backwardReplacedLine, -1)
// get first matchgroup, first match (aka first digit in forwardReplacedLine)
// get first match, first matchgroup (aka first digit in forwardReplacedLine)
first := firstMatch[0][0]
// get last matchgroup, first match (aka last digit in backwardReplacedLine)
// get last match, first matchgroup (aka last digit in backwardReplacedLine)
last := lastMatch[len(lastMatch)-1:][0][0]
fmt.Println(first + last)