Live data from Hacker News

Can you solve it? The Greplin programming challenge

challenge.greplin.com

31–40 of 167 posts

Re: Can you solve it? The Greplin programming challenge

#31
post #23

So what languages did everyone use? I decided to try a different one on each level, so I used Python, bash (letting GNU coreutils 'factor' do the hard work), and Haskell, respectively.

Ruby was my main choice + some command line tools to do bits of extra work, like 'sort' to find the largest palindrome and 'wc' to count the results in last exercise, and even Python command line to just manually sum the primes in second exercise.

Re: Can you solve it? The Greplin programming challenge

#33
post #3

Uh ... call a phone number? No thanks. Edit: Excellent! Back to hacking.

I'm curious to know why calling a phone number was a deal-breaker.

It seemed eminently likely (to me) that it would be an automated system, but, even if it wasn't, talking to someone isn't that big a deal to me. I certainly wasn't concerned about long-distance charges, but I suppose that might be a problem for some.

I thought it was a nice little twist in the problem set.

Re: Can you solve it? The Greplin programming challenge

#35
post #3

Uh ... call a phone number? No thanks. Edit: Excellent! Back to hacking.

I'm curious to know why calling a phone number was a deal-breaker. It seemed eminently likely (to me) that it would be an automated system, but, even if it wasn't, talking to someone isn't that big a deal to me. I certainly wasn't concerned about long-distance charges, but I suppose that might be a problem for some. I thought it was a nice little twist in the problem set.

but, even if it wasn't, talking to someone isn't that big a deal to me.

A lot of people struggle with the phone. I certainly have, though I'm getting better at it. I've noticed many people become spookily compliant on the phone, endlessly listening to and being polite to even the most annoying callers instead of just hanging up.

Re: Can you solve it? The Greplin programming challenge

#36
post #19

Anybody else browsing by mobile try to do Level 1 by inspection?

Brute works here because of bad test case. Author could have generated a smart test case and then optimal algorithm could be using suffix array which takes O(n), brute would take O(n!). However a bit smart brute gave the answer in approx 3-4 minutes ( computation + coding time). And yes, Python FTW.

Isn't brute force just O(n^3)? Loop over each character to start potential palindrome, loop from start character to end, reverse substring and compare. But yeah, the test input should be longer and/or smarter. Ditto on the third problem.

Re: Can you solve it? The Greplin programming challenge

#39
post #19

Earlier quoted context omitted.

Brute works here because of bad test case. Author could have generated a smart test case and then optimal algorithm could be using suffix array which takes O(n), brute would take O(n!). However a bit smart brute gave the answer in approx 3-4 minutes ( computation + coding time). And yes, Python FTW.

Isn't brute force just O(n^3)? Loop over each character to start potential palindrome, loop from start character to end, reverse substring and compare. But yeah, the test input should be longer and/or smarter. Ditto on the third problem.

reverse substring and compare

D'oh! My is_palindrome(word) just got a lot shorter, thanks :)

Post reply on HN