diff --git a/d07/part1.awk b/d07/part1.awk index 57483cf..fe22b48 100644 --- a/d07/part1.awk +++ b/d07/part1.awk @@ -7,7 +7,7 @@ $2 == "cd" && $3 == ".." { S[depth]=0 depth -= 1 } -$2 == "cd" && $3 != ".." { depth += 1; P[depth]=$3; } +$2 == "cd" && $3 != ".." { depth ++ } NF == 2 { for (i=1;i<=depth;i++) { S[i]+=$1