This repo contains my attempt at Advent of Code 2024 with Golang. Inside there will be code solutions separated by the advent days folder.
- Day 2 p2
append()
slice function modifies the original slice
- Day 3
- Golang regex are not able to do lookaheads
(?=)
or lookbehind(?<=)
due to it using RE2- Can convert such expresion to using non-capturing group instead
(?:)
- Can convert such expresion to using non-capturing group instead
- Golang regex are not able to do lookaheads
- Day 9
- Slices is always pass by reference while arrays are pass by value. Use
copy()
to copy slices into new variables. fmt.Printf("%+v\n", v)
use%+v
to print the struct key as well
- Slices is always pass by reference while arrays are pass by value. Use
- Day 14
- When iterating over a slice, the
v
value fromi,v := range ...
is copied by value. So any update wont be affect the underlying array
- When iterating over a slice, the