1 (ns adventofcode2019.day04
2 [:require [adventofcode2019.lib :refer :all]
3 [clojure.string :as str]
4 [clojure.math.combinatorics :as combo]])
6 (defn find-passwords [low high]
7 (let [dupe-digits #(some (partial apply =) (partition 2 1 %))
8 increasing (partial apply <=)
9 to-digits #(map int (str %))]
10 (->> (range low (inc high))
12 (filter (every-pred dupe-digits increasing)))))
15 (let [[low high] [0 1]
16 passwords (find-passwords low high)]
17 (part1 (count passwords))