summary refs log tree commit diff homepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--2022/day04.awk12
1 files changed, 12 insertions, 0 deletions
diff --git a/2022/day04.awk b/2022/day04.awk
new file mode 100644
index 0000000..78ff511
--- /dev/null
+++ b/2022/day04.awk
@@ -0,0 +1,12 @@
+BEGIN {
+	FS = "[-,]";
+}
+function contains(a, b, x, y) {
+	return x >= a && y <= b;
+}
+{
+	if (contains($1, $2, $3, $4) || contains($3, $4, $1, $2)) pairs++;
+}
+END {
+	print pairs;
+}
6de38c89acd25c52d40843ece597c1be912f5fbc&follow=1'>Add missing static declarations in html.cJune McEnroe 2021-05-07Reverse order of search resultsJune McEnroe 2021-05-07Try to keep query at end of parametersJune McEnroe 2021-05-07Use LDADD variables, support BINDIRJune McEnroe 2020-12-13Use nick for color if user is "*" 1.1June McEnroe 2020-08-23Use DESTDIR in install 1.0June McEnroe 2020-08-23Add catsit example to READMEJune McEnroe 2020-08-23Update litterbox version rangeJune McEnroe 2020-08-19Set a database busy timeoutJune McEnroe 2020-07-29Add Linux supportJune McEnroe 2020-07-29Remove unused prevEventJune McEnroe 2020-07-23Rewrite configure scriptJune McEnroe 2020-07-21Add OpenBSD instructionsJune McEnroe 2020-07-21Use a .pc file to configureJune McEnroe 2020-07-19Filter networks with only private contexts from recents as wellJune McEnroe 2020-07-18Specify litterbox version in readmeJune McEnroe 2020-07-18Reverse order of X macro parameters for pages and keysJune McEnroe 2020-07-18Remove kcgi 0.11 compatibilityJune McEnroe 2020-07-17Filter networks with only private contextsJune McEnroe 2020-07-17Add export optionJune McEnroe 2020-07-17Add margin to inputsJune McEnroe 2020-07-16Don't write null terminator in stylesheet responseJune McEnroe 2020-07-16Remove sudo from make installJune McEnroe