aboutsummaryrefslogtreecommitdiff
path: root/2019/04/puzzles.sh
diff options
context:
space:
mode:
Diffstat (limited to '2019/04/puzzles.sh')
-rw-r--r--2019/04/puzzles.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/2019/04/puzzles.sh b/2019/04/puzzles.sh
new file mode 100644
index 0000000..b3bcfed
--- /dev/null
+++ b/2019/04/puzzles.sh
@@ -0,0 +1,8 @@
+IFS=- read lo hi <input
+seq $lo $hi |
+ grep -E '([0-9])\1' |
+ grep -E '^0*1*2*3*4*5*6*7*8*9*$' |
+ # START PART 2
+ grep -E '^(0{2}1*2*3*4*5*6*7*8*9*|0*1{2}2*3*4*5*6*7*8*9*|0*1*2{2}3*4*5*6*7*8*9*|0*1*2*3{2}4*5*6*7*8*9*|0*1*2*3*4{2}5*6*7*8*9*|0*1*2*3*4*5{2}6*7*8*9*|0*1*2*3*4*5*6{2}7*8*9*|0*1*2*3*4*5*6*7{2}8*9*|0*1*2*3*4*5*6*7*8{2}9*|0*1*2*3*4*5*6*7*8*9{2})$' |
+ # END PART 2
+ wc -l \ No newline at end of file