From 8ccbf40783eeb47f9f69bb2cc45eaf5a0d0510f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abdulkadir=20Furkan=20=C5=9Eanl=C4=B1?= Date: Tue, 5 Dec 2023 14:15:19 +0100 Subject: [PATCH] Cleanup --- 2/1/solution.sh | 1 - 4/1/solution.sh | 4 ---- 4/2/solution.sh | 2 -- 3 files changed, 7 deletions(-) diff --git a/2/1/solution.sh b/2/1/solution.sh index 0fc753b..f4e8fa2 100755 --- a/2/1/solution.sh +++ b/2/1/solution.sh @@ -31,7 +31,6 @@ main () possible_ids+=($id) fi done < input.txt - echo "${possible_ids[@]}" declare -i sum=0 for id in "${possible_ids[@]}"; do (( sum+=id )) diff --git a/4/1/solution.sh b/4/1/solution.sh index 9e2ecb0..014d160 100755 --- a/4/1/solution.sh +++ b/4/1/solution.sh @@ -15,7 +15,6 @@ main () while read -r line; do declare -a winning=() mine=() mywinning=() declare -i card_sum=0 - echo "$line" stripped=$(sed 's/Card\s\{1,3\}[0-9]\{1,3\}: //' <<< "${line}") winning+=($(cut -d '|' -f 1 <<< "${stripped}")) mine+=($(cut -d '|' -f 2 <<< "${stripped}")) @@ -27,7 +26,6 @@ main () fi done done - echo mywwinning ${mywinning[@]} for number in "${mywinning[@]}"; do if [[ card_sum -eq 0 ]]; then card_sum=$((card_sum+1)) @@ -35,9 +33,7 @@ main () card_sum=$((card_sum*2)) fi done - echo "card sum: $card_sum" sum=$((sum+card_sum)) - echo "sum: ${sum}" done < input.txt echo "${sum}" } diff --git a/4/2/solution.sh b/4/2/solution.sh index 1baff29..d0e34e3 100755 --- a/4/2/solution.sh +++ b/4/2/solution.sh @@ -14,7 +14,6 @@ CARDS="${#INPUT[@]}" run_cards () { - # Receives space separated list of cards I have. for ((x=1; x<=CARDS; x++)); do declare -a winning=() mine=() declare -i matching=0 @@ -45,7 +44,6 @@ main () done run_cards "${hand[@]}" for ((z=1; z<=CARDS; z++)); do - echo "card $z: ${hand[$z]}" sum=$((sum+${hand[$z]})) done echo "${sum}"