From fc7e08ef0e4868554af3de6e34267517172e07e9 Mon Sep 17 00:00:00 2001 From: Clement Date: Thu, 12 Dec 2024 17:52:33 +0800 Subject: [PATCH] Fix test case 2 --- 2024/day-12/solution-1.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/2024/day-12/solution-1.sh b/2024/day-12/solution-1.sh index f1c3a97..ea81264 100644 --- a/2024/day-12/solution-1.sh +++ b/2024/day-12/solution-1.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash FUNCNEST=99999 -FILE=test-input-2 +FILE=test-input-1 read -r -a MAP_ARRAY <<< "$( < "$FILE" paste -s -d "" | sed -E 's/(.)/\1\ /g' )" MAP_LEN=${#MAP_ARRAY[@]} MAP_WIDTH=$(( $( head -1 "$FILE" | wc -c ) -1 )) @@ -98,7 +98,7 @@ do printf "%s:" "${CHAR_ARRAY[i]}" MIN=$(( $(( i-MAP_WIDTH )) < 0 ? 0 : $(( i-MAP_WIDTH )) )) MAX=$(( $(( i+MAP_WIDTH )) < MAP_LEN ? $(( i+MAP_WIDTH )) : $(( MAP_LEN )) )) - for (( j=MIN; j