Mumbling
Example
accum("abcd") ;; "A-Bb-Ccc-Dddd"
accum("RqaEzty") ;; "R-Qq-Aaa-Eeee-Zzzzz-Tttttt-Yyyyyyy"
accum("cwAt") ;; "C-Ww-Aaa-Tttt"
Solution
(ns accumule.core)
(defn repeat-capitalize [i elm]
(clojure.string/capitalize (apply str (repeat (inc i) elm))))
(defn accum [s]
(clojure.string/join "-" (map-indexed repeat-capitalize s)))
(map-indexed f)(map-indexed f coll)
(map-indexed list [:a :b :c]) ;; ((0 :a) (1 :b) (2 :c))
(map-indexed hash-map "bar") ;; ({0 \b} {1 \a} {2 \r})
(map-indexed vector "bar") ;;([0 \b] [1 \a] [2 \r])