Move to have day be 2 digit always
[advent-of-code-2020.git] / day02 / static / gitweb.js
diff --git a/day2/get_valid_count.sh b/day2/get_valid_count.sh
deleted file mode 100644 (file)
index d6ca89e..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/bin/bash
-
-check_file() {
-    cat input.txt | while read line; do
-        password=${line#*: }
-        params=${line%: *}
-        min=${params%-*}
-        params=${params#*-}
-        max=${params% *}
-        char=${params#* }
-        count=0
-        for ((i=0; i<${#password}; i++)); do
-            if [ "${password:$i:1}" = "$char" ]; then
-                count=$((count+1))
-            fi
-        done
-        if [ $count -ge $min ] && [ $count -le $max ]; then
-            echo "Got valid line!"
-        fi
-    done
-}
-
-echo "Got $(check_file | wc -l) valid lines"
-
-exit 0
-#!/usr/bin/python3
-
-import regex
-
-total_lines=0
-valid_lines=0
-for line in open("input.txt", "r"):
-    total_lines += 1
-    (min_count, max_count, letter, password) = regex.match('([0-9]+)-([0-9]+) ([a-z]): ([a-z]*)', line).group(1,2,3,4)
-    min_count=int(min_count)
-    max_count=int(max_count)
-    count = 0
-    for x in password:
-        if x == letter:
-            count += 1
-    if count >= min_count and count <= max_count:
-        valid_lines += 1
-
-print(valid_lines, "valid lines of", total_lines)