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.
23 lines
377 B
23 lines
377 B
package day02
|
|
|
|
import "log"
|
|
|
|
func Solve2() {
|
|
counter := 0
|
|
|
|
for _, row := range rows {
|
|
lowerChar := row.Password[row.LowerIndex-1]
|
|
higherChar := row.Password[row.HigherIndex-1]
|
|
|
|
if lowerChar == higherChar {
|
|
continue
|
|
}
|
|
|
|
if lowerChar == row.ValidationChar || higherChar == row.ValidationChar {
|
|
counter++
|
|
}
|
|
}
|
|
|
|
log.Println("2020-12-02.02: Answer:", counter)
|
|
}
|