Ad
  • Custom User Avatar

    I'm having the same issue. I don't know what the value of n is for the test which times out, but on my machine I can go up to ~3500:

    user=> (time (series-sum 3500))
    "Elapsed time: 9775.32137 msecs"
    "3.76"
    

    I believe the code is right, as it solves a case which the author has provided an answer in a comment here:

    user=> (time (series-sum 59))
    "Elapsed time: 0.998973 msecs"
    "2.40"
    
  • Custom User Avatar

    Probably a typo, but your fixed test should be:

    (is (= (head [5 1]) 5))