This commit is contained in:
2024-12-08 23:52:17 +08:00
parent cdd982a73c
commit ee587b234b
2 changed files with 7 additions and 4 deletions

View File

@ -1,5 +1,8 @@
#!/usr/bin/env awk #!/usr/bin/env awk
# Just pre-compute all possible results
# and check against the sum
BEGIN { BEGIN {
FS = "[: ]" FS = "[: ]"
total = 0 total = 0

View File

@ -13,10 +13,10 @@ do
LINE="$( LINE="$(
for (( i=0; i<${#MAP_ARRAY[@]}; i++ )) for (( i=0; i<${#MAP_ARRAY[@]}; i++ ))
do do
if [[ ${MAP_ARRAY[i]} == "$CHAR" ]] if [[ ${MAP_ARRAY[i]} == "$CHAR" ]]
then then
printf "%s " "$i" printf "%s " "$i"
fi fi
done done
)" )"
printf "%s\n" "$LINE" >&2 printf "%s\n" "$LINE" >&2