summary refs log tree commit diff homepage
path: root/2022/day01.awk
blob: 0fbde52b19027689c5bf684b070399d706e0a96c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/[[:digit:]]+/ {
	cals += $1;
}
function push() {
	if (cals > max1) {
		max3 = max2;
		max2 = max1;
		max1 = cals;
	} else if (cals > max2) {
		max1 = max2;
		max2 = cals;
	} else if (cals > max3) {
		max3 = cals;
	}
	cals = 0;
}
/^$/ {
	push();
}
END {
	push();
	print max1;
	print max1 + max2 + max3;
}
6da&follow=1'>Document configuration and data file searchJune McEnroe 2020-08-24Use dataOpen for save fileJune McEnroe 2020-08-24Use configOpen to load localCAJune McEnroe 2020-08-24Use configPath to load client cert/privJune McEnroe 2020-08-24Use configOpen in getopt_configJune McEnroe 2020-08-24Import xdg.c from catgirlJune McEnroe 2020-08-23Replace “RAND_bytes” by “getentropy”Issam E. Maghni 2020-08-16contrib/palaver: Add no message preview flagsJune McEnroe 2020-08-13contrib/palaver: Don't set channel for PMsJune McEnroe 2020-08-13Fix unintended interception of NICK after registrationJune McEnroe 2020-08-12Add Additional Components section to READMEJune McEnroe 2020-08-12Document -L / palaver optionJune McEnroe 2020-08-11contrib/palaver: Document service configurationJune McEnroe 2020-08-11contrib/palaver: Add install target and rc scriptJune McEnroe 2020-08-11contrib/palaver: Implement command and notificationsJune McEnroe