about 30 lines of code in the tersest style, 40ish in the readability-obsesssive style I prefer
Can you solve it? The Greplin programming challenge
81–90 of 167 posts
Re: Can you solve it? The Greplin programming challenge
#82Uh ... 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.
Yet also, I'm so tired I couldn't have englished very well in my phone anyway. :-)
Re: Can you solve it? The Greplin programming challenge
#83Uh ... 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
#84Re: Can you solve it? The Greplin programming challenge
#85Re: Can you solve it? The Greplin programming challenge
#86Re: Can you solve it? The Greplin programming challenge
#87Is there a better algorithm? Dynamic programming of some sort? I guess we'd need a longer string to tell the difference.
Re: Can you solve it? The Greplin programming challenge
#88"Even if you're not looking for a job, we'd love to hear what you thought about the challenge." I would be curious how many people did you lose because of phonecall requirement (before you changed it). Also CSV for just a list of 22 numbers wasn't really necessary. If you do web puzzle, the best is to keep everything self-contained, no downloads, no using external channels, just copy and paste. FYI another Python che…
I don't think trivializing the combinations with Python's builtins, looking up the fib primes with OEIS, or computing factors with Alpha is cheating. I hope, in fact, it's the whole point of the exercise: choose the right tools for the job. If you're writing code to test primeness or generate Fibonacci numbers, I sure as hell don't want to hire you.
It was way more fun to do it from scratch :D
Thanks grepplin
p.s. the csv was copied in my [] python list :)
Re: Can you solve it? The Greplin programming challenge
#89Earlier quoted context omitted.
for #3 used a combination generator Congratulations, you just used an exponential-time algorithm for a polynomial-time problem.
Congratulations are in order, he sacrificed 400ms CPU time to save at least a few minutes of coding time.
Re: Can you solve it? The Greplin programming challenge
#90So 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.
I should note that I used the existing C code I had because I had no idea where they would intersect and didn't feel like writing Yet Another Arbitrarily Large Integer Handler.