aboutsummaryrefslogtreecommitdiff
path: root/2021/08/first.go
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--2021/08/first.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/2021/08/first.go b/2021/08/first.go
new file mode 100644
index 0000000..d21fe67
--- /dev/null
+++ b/2021/08/first.go
@@ -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)
+}