Two brute force methods for part 2. Slow.

This commit is contained in:
2024-12-11 20:53:40 +08:00
parent d2d4bf7a64
commit 39e8e8735b
2 changed files with 110 additions and 4 deletions

View File

@ -55,13 +55,11 @@ blink_rocks () {
#printf "\n" >&2
}
#FINAL_LIST=()
# Keeps track of
read -r -a FINAL_LIST <<< "$( printf "%s " "${ROCK_LIST[@]}" )"
POSITION=0
while [[ $POSITION -lt $BLINK_NUM ]]
do
printf "%s Working on position %s\n" "$( date )" "$POSITION"
printf "%s Starting position %s, current len: %s, kv size: %s\n" "$( date )" "$POSITION" "${#FINAL_LIST[@]}" "${#KV_CACHE[@]}"
INTER_LIST_1=()
# Essentially move $DEPTH steps at a time
for ROCK in "${FINAL_LIST[@]}"
@ -93,7 +91,6 @@ do
# All rocks are calculated $DEPTH ahead
(( POSITION+=DEPTH ))
done
#FINAL_LIST+=( "${BLINKED_ROCKS[@]}" )
# Dump KV cache for debugging
if [[ $DUMP_KV_CACHE -eq 0 ]]