diff --git a/day/02/demo_2_input.txt b/day/02/demo_2_input.txt index baeffbb..118a3b8 100644 --- a/day/02/demo_2_input.txt +++ b/day/02/demo_2_input.txt @@ -7,3 +7,4 @@ 9 8 2 7 9 8 7 1 9 4 10 11 +9 4 10 11 10 diff --git a/day/02/part2.sh b/day/02/part2.sh index edf037a..4786e7b 100755 --- a/day/02/part2.sh +++ b/day/02/part2.sh @@ -93,7 +93,11 @@ while read -r l; do if [[ "${idx}" -eq 1 ]]; then # we may have to re-calculate is_up_down! is_up_down="$((line_split[2] - line_split[0]))" + echo "allowing flip up/down" fi + echo "-------------------" + echo "allowing 1 failure!" + echo "-------------------" else # we skip the re-assign once to 'skip' a number prev_val=$v @@ -105,7 +109,7 @@ while read -r l; do else echo "final check safe" fi - + echo "" safe_count=$((safe_count + is_safe)) done <"$FILE_IN"