summary refs log tree commit diff homepage
diff options
context:
space:
mode:
-rw-r--r--2019/day04.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/2019/day04.sh b/2019/day04.sh
new file mode 100644
index 0000000..6cd264a
--- /dev/null
+++ b/2019/day04.sh
@@ -0,0 +1,11 @@
+IFS=-
+read min max
+seq "$min" "$max" \
+	| grep '^1*2*3*4*5*6*7*8*9*$' \
+	| grep -E '00|11|22|33|44|55|66|77|88|99' \
+	| wc -l
+seq "$min" "$max" \
+	| grep '^1*2*3*4*5*6*7*8*9*$' \
+	| sed 's/.*/x&x/' \
+	| grep -E '[^0]00[^0]|[^1]11[^1]|[^2]22[^2]|[^3]33[^3]|[^4]44[^4]|[^5]55[^5]|[^6]66[^6]|[^7]77[^7]|[^8]88[^8]|[^9]99[^9]' \
+	| wc -l
='3' class='logmsg'> 2018-08-18Run {,s,t}up with /bin/shJune McEnroe 2018-08-18Use whence instead of typeJune McEnroe type is an alias for whence -v and is more for human consumption. 2018-08-18Cut off path components until right prompt fitsJune McEnroe Keeps paths valid (from somehwere) rather than abrupt truncation. 2018-08-17Add "private" alias to source encrypted fileJune McEnroe Why is there no easy way to *edit* an encrypted file? 2018-08-17Add vim mapping to add a #includeJune McEnroe