News for hackers. Stuff that matters.
Re:Can you solve it? The Greplin programming challenge by nomurrcy on Friday October 08, 2010 @04:54PM (#1773344)
Clojure here.
Re:Can you solve it? The Greplin programming challenge by djacobs on Friday October 08, 2010 @06:20PM (#1773657)
Mind posting your solution as a Gist? I want to see how to do level 1 without explicit loops or variables.
Re:Can you solve it? The Greplin programming challenge by nomurrcy on Monday October 11, 2010 @04:15PM (#1781063)
Sure, sorry about the delay.

http://gist.github.com/621130

I can't take credit for the solution I posted though.

I originally wrote a naive O(N^2) complexity solution (which was much shorter and was fine for the length of the input) I had this palindrome code in my 'toolbox' of code I've come across though, I'm afraid I don't know the orig author.

I just tweaked it as this is more in line with the type of example you're looking for.

Re:Can you solve it? The Greplin programming challenge by djacobs on Tuesday October 19, 2010 @11:01PM (#1809777)
Interesting, I'll have to go over your code fairly carefully, as I'm not familiar with every technique you're using here for performance.

I've since learned a good deal about Clojure and implemented an idiomatic (but probably less performant) version, for anyone interested in how short this can be:

http://gist.github.com/635674