diff --git a/d01/d01_1.awk b/d01/d01_1.awk index 6c92772..00ad296 100644 --- a/d01/d01_1.awk +++ b/d01/d01_1.awk @@ -1,16 +1,4 @@ -NR == 1 { - A = $1 - next -} - -$1 > A { - N++ -} - -{ - A = $1 -} - -END { - print N -} \ No newline at end of file +NR == 1 { A = $1; next } +$1 > A { N++ } +{ A = $1 } +END { print N } diff --git a/d01/d01_2.py b/d01/d01_2.py index c74a859..f2393ee 100644 --- a/d01/d01_2.py +++ b/d01/d01_2.py @@ -1,3 +1,10 @@ import sys L = [int(l[:-1]) for l in sys.stdin.readlines()] -print(sum([0,1][a