add daythree + benchmarks

This commit is contained in:
2024-12-03 14:42:28 +00:00
parent 64f4df4fea
commit f0bf82c96a
14 changed files with 309 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
package util
import (
"regexp"
"strconv"
)
func GetGroups(r *regexp.Regexp, s string) map[string]string {
groups := make(map[string]string)
names := r.SubexpNames()
for i, res := range r.FindStringSubmatch(s) {
if i != 0 {
groups[names[i]] = res
}
}
return groups
}
func MustConv(s string) int {
n, err := strconv.Atoi(s)
if err != nil {
panic(err)
}
return n
}