 (defn digits
   "**digits :: Int -> [Int]**
   Converts a number n into a list of its digits."
-  [n] (map #(Character/digit % 10) (str n)))
+  [n] (map #(Character/getNumericValue %) (str n)))
 
 (defn narcissistic?
   "**narcissistic? :: Int, Int -> Bool**

   (cond
     (= 1 number) factors
     (factor? number (first ps)) (prime-factors (/ number (first ps))
                               (conj factors (first ps)) ps)
     :else (prime-factors number factors (rest ps)))))

(defn count-divisors

(ns euler.helper)

;; == point-free notation =====================================================
;; shortcuts
(def & "function composition" comp)
(def p "partial application" partial)

;; == benchmarking ============================================================
;; taken from https://adambard.com/blog/clojure-reducers-for-mortals/

(defn benchmark
  "Map f over the range of N x times."
  [f N x] (let [nums (vec (range N))
                start (java.lang.System/currentTimeMillis)]
            (dotimes [n x]
              (f nums))
            (- (java.lang.System/currentTimeMillis) start)))

;; == factorisation ===========================================================

