Two brute force methods for part 2. Slow.
This commit is contained in:
@ -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 ]]
|
||||
|
Reference in New Issue
Block a user