4 cat input.txt | while read line; do
12 for ((i=0; i<${#password}; i++)); do
13 if [ "${password:$i:1}" = "$char" ]; then
17 if [ $count -ge $min ] && [ $count -le $max ]; then
18 echo "Got valid line!"
23 echo "Got $(check_file | wc -l) valid lines"
32 for line in open("input.txt", "r"):
34 (min_count, max_count, letter, password) = regex.match('([0-9]+)-([0-9]+) ([a-z]): ([a-z]*)', line).group(1,2,3,4)
35 min_count=int(min_count)
36 max_count=int(max_count)
41 if count >= min_count and count <= max_count:
44 print(valid_lines, "valid lines of", total_lines)