added task 2
This commit is contained in:
parent
17599f4fe7
commit
032f129cb2
1
1/day1-1.awk
Executable file
1
1/day1-1.awk
Executable file
@ -0,0 +1 @@
|
|||||||
|
BEGIN{sum=0; max_sum=0} {if (NF != 0) {sum+=$1} else {if (sum > max_sum) {max_sum=sum}; sum=0}} END{print max_sum}
|
2
1/day1-2.sh
Executable file
2
1/day1-2.sh
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
awk 'BEGIN{sum=0} {if (NF != 0) {sum+=$1} else {print sum; sum=0}}' input.txt | sort -n | tail -n 3 | awk 'BEGIN{sum=0} {sum+=$1} END{print sum}'
|
Loading…
Reference in New Issue
Block a user