2 ms·
Nesting can be sorted via macros, e.g. closures threading macros (defn unique [str] (->> (str/split str #"\s+") (map #(Integer/parseInt
by LandR 7y ago
Nesting can be sorted via macros, e.g. closures threading macros
(defn unique [str]
(->> (str/split str #"\s+")
(map #(Integer/parseInt %))
(partition-by even?)
(take-while #(not= (count %) 1))
(first)
(count)
(inc)))
(unique "2 4 6 8 7 10 12")
=> 5