mirror of
https://github.com/onyx-and-iris/aoc2023.git
synced 2024-11-15 15:10:49 +00:00
19 lines
278 B
Go
19 lines
278 B
Go
package main
|
|
|
|
import "strings"
|
|
|
|
var lenses = []string{}
|
|
|
|
// one returns the sum of all hashed values
|
|
func one(lines []string) int {
|
|
lenses = strings.Split(lines[0], ",")
|
|
hash := newHasher()
|
|
|
|
sum := 0
|
|
for _, lense := range lenses {
|
|
sum += hash.run(lense)
|
|
}
|
|
|
|
return sum
|
|
}
|