It seems that the Integer/parseInt is very slow in the sandbox of 4clojure.
so you can replace it with something else.
I tried your solution and replaced the Integer/parseInt, it works fine.
On Tuesday, July 10, 2012 10:56:52 PM UTC+8, Jannik Jochem wrote:
> Hello,
> I've been trying to solve Problem 120<http://www.4clojure.com/problem/120>.
> In a REPL, the following solution works:
> (fn [xs]
> (count
> (filter
> (fn [x]
> (< x
> (reduce + (map
> (comp #(* % %) #(Integer/parseInt (str %)))
> (seq (str x))))))
> xs)))
> When I try to submit this solution, I always hit a timeout. Is it possible
> that the last test case is a little over the top?
> Cheers,
> Jannik