This commit is contained in:
2021-12-06 09:28:48 +01:00
parent c03cb5a03e
commit 8114113a2e
2 changed files with 38 additions and 0 deletions

17
06/01.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
read line
anglerfishes=( ${line//,/ } )
for i in $(seq 80); do
new_anglerfishes=()
for j in $(seq ${#anglerfishes[@]}); do
if [ ${anglerfishes[$((j-1))]} -eq 0 ]; then
anglerfishes[$((j-1))]=7
new_anglerfishes+=( 8 )
fi
anglerfishes[$((j-1))]=$((anglerfishes[j-1]-1))
done
anglerfishes+=("${new_anglerfishes[@]}")
done
echo ${#anglerfishes[@]}