fork(1) download
  1. (defn count-out-consecutive
  2. [matrix starting-coords direction]
  3. (loop [coords starting-coords, counter 0]
  4. (if (= (get-in matrix coords) (get-in matrix starting-coords))
  5. (recur (mapv + coords direction) (inc counter))
  6. counter)))
  7.  
  8. (-> [[1 2 3]
  9. [4 nil 5]
  10. [6 7 nil]]
  11. (count-out-consecutive '(1 1) '(1 1)))
Time limit exceeded #stdin #stdout 5s 4386816KB
stdin
Standard input is empty
stdout
Standard output is empty