You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
317 B
21 lines
317 B
package day02
|
|
|
|
import (
|
|
"log"
|
|
"strings"
|
|
)
|
|
|
|
func Solve1() {
|
|
counter := 0
|
|
|
|
for _, row := range rows {
|
|
occurances := strings.Count(row.Password, string(row.ValidationChar))
|
|
|
|
if row.LowerIndex <= occurances && occurances <= row.HigherIndex {
|
|
counter++
|
|
}
|
|
}
|
|
|
|
log.Println("2020-12-02.01: Answer:", counter)
|
|
}
|