day 02
This commit is contained in:
1000
01/input.txt
Normal file
1000
01/input.txt
Normal file
File diff suppressed because it is too large
Load Diff
@@ -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)
|
||||
|
Reference in New Issue
Block a user