You are viewing a single comment's thread. Return to all comments →
Clojure solution:
(defn jumpingOnClouds [c] (let [cc (dec (count c))] (loop [i 0 j 0] (cond (>= i cc) j (= i (dec cc)) (inc j) true (recur (+ i (if (pos? (nth c (+ i 2))) 1 2)) (inc j))))))
Jumping on the Clouds
You are viewing a single comment's thread. Return to all comments →
Clojure solution: