diff --git a/2024/day-5/solution-2.sh b/2024/day-5/solution-2.sh index 7505ce1..44a7572 100644 --- a/2024/day-5/solution-2.sh +++ b/2024/day-5/solution-2.sh @@ -41,18 +41,17 @@ INPUT_RULES=$(cat input-rules) if [[ ${KV_ARRAY[$i]} -eq $KEY ]] then KEY=${KV_ARRAY[$i+1]} - BREAK=1 - break + BREAK=1 + break fi done - if [[ $BREAK -eq 1 ]] ; then continue ; else break ; fi + if [[ $BREAK -eq 1 ]] ; then continue ; else break ; fi done printf "%s\n" "$KEY" CACHED_LINE=$( printf "%s" "$CACHED_LINE" | grep -v "$KEY" ) done | tac | paste -s -d' ' done } | - tee final-output | awk ' BEGIN{ total = 0 } {