This commit is contained in:
Abdulkadir Furkan Şanlı 2023-12-06 12:39:55 +01:00
parent 2705bd5aab
commit 543e341bda
Signed by: afk
GPG Key ID: C8F00588EE6ED1FE

View File

@ -7,12 +7,12 @@ if [[ "${TRACE-0}" == "1" ]]; then
set -o xtrace set -o xtrace
fi fi
cd "$(dirname "$0")" INPUT="$1"
main () main ()
{ {
IFS=' ' read -r -a times <<< "$(grep Time input | awk '{$1=""; print $0}')" IFS=' ' read -r -a times <<< "$(grep Time ${INPUT} | awk '{$1=""; print $0}')"
IFS=' ' read -r -a distances <<< "$(grep Distance input | awk '{$1=""; print $0}')" IFS=' ' read -r -a distances <<< "$(grep Distance ${INPUT} | awk '{$1=""; print $0}')"
declare -a winning_counts=() declare -a winning_counts=()
records="${#times[@]}" records="${#times[@]}"
for ((i=0; i<records; i++)); do for ((i=0; i<records; i++)); do