Test day4pt1 and add correct day4pt2
[adventofcode2019.git] / src / adventofcode2019 / day04.clj
index 0c5c08d1daf9c8c25787db382c66547d9205e10a..0129398da89f405de8aa5761eece621dfeee0468 100644 (file)
@@ -12,7 +12,9 @@
         (filter (every-pred dupe-digits increasing)))))
 
 (defn day04 []
-  (let [[low high] [0 1]
-        passwords (find-passwords low high)] 
+  (let [[low high] [307237 769058]
+        passwords (find-passwords low high)
+        strict-dd (fn [x] (some #(= (count %) 2) 
+                                (partition-by identity x)))] 
     (part1 (count passwords))
-    #_(part2 nil)))
+    (part2 (count (filter strict-dd passwords)))))