Live data from Hacker News

The ReadyForZero Programming Challenge

readyforzero.com

51–60 of 61 posts

Re: The ReadyForZero Programming Challenge

#51
That was a fun before-breakfast warmup; the input was always short enough that a simple, brute-force approach would usually work. The problem statements could have been made a little bit clearer though.

And what's up with the green-on-black Mac screen?!

EDIT: my solutions (using Node.js) https://github.com/julienq/incubator/tree/master/misc/readyf...

Re: The ReadyForZero Programming Challenge

#53
post #41

Earlier quoted context omitted.

You mean with smart guessing? That's no fun!

Yeah. It took me three guesses to get it right. :)

You didn't need 3 guesses. The sum of each partition has to be a factor of the number. In particular the sum of the first partition has to be a factor. Then the second. That already gives you the answer I think.

Re: The ReadyForZero Programming Challenge

#54
post #53
post #41

Earlier quoted context omitted.

Yeah. It took me three guesses to get it right. :)

You didn't need 3 guesses. The sum of each partition has to be a factor of the number. In particular the sum of the first partition has to be a factor. Then the second. That already gives you the answer I think.

Sure, but then I'd actually have to look at the numbers. My solution works without having to download the file! ;)

Re: The ReadyForZero Programming Challenge

#56

Earlier quoted context omitted.

The third problem is looking to partition the entire sequence of numbers into contiguous subsequences, all of which add up to the same sum. In other words, if the list were 23415, you subsequences could be 23, 41 and 5, all equaling 5. But the subsequences have to use up the entire string and they can't overlap.

They can't overlap! I don't think the problem specifies that? You have to interpret "break up" to mean "non-overlapping" to claim that the problem means what you're saying it means; I found 341 "contiguous subsequences such that the sums of each of the subsequences are equal", but they overlap. (If you had said "partition" I suspect I would have got what you meant)

Contiguous implies non-overlapping.

Re: The ReadyForZero Programming Challenge

#58
post #27

Earlier quoted context omitted.

> #pip install python-levenshtein > from Levenshtein import distance That doesn't seem in the spirit of the challenge.

Can you do it in linear time in the length of the input?

Find an actual (amortized) linear time implementation for this question in the following gist:

https://gist.github.com/1026638

Post reply on HN