Added solutions for 8th day : the seven segments code to guess

This commit is contained in:
Julien Dessaux 2021-12-09 17:54:15 +01:00
parent 19d312c0fb
commit 984d3d5ebb
4 changed files with 378 additions and 0 deletions

25
2021/08/first.go Normal file
View file

@ -0,0 +1,25 @@
package main
import (
"bufio"
"fmt"
"os"
"strings"
)
func main() {
score := 0
s := bufio.NewScanner(os.Stdin)
for s.Scan() {
inputs := strings.Split(s.Text(), " | ")
output := strings.Split(inputs[1], " ")
for _, v := range output {
l := len(v)
if l < 5 || l == 7 {
score++
}
}
}
fmt.Println(score)
}