On 7/13/07, anansi [email protected] wrote:
is
but why is [2, 5, -1, 3] sum= 9 the sub-array with the maximum sum?
wouldnât be [2,5,3,1] sum=11 the right solution?
A sub-array is a contiguous list within the overall array.
For [a,b,c], the sub-arrays are
[a], [b], [c], [a,b], [b,c] and of course [a,b,c], but [a,c] is NOT a
sub-array because the elements are not contiguous within the overall
array.
Iâm looking forward to tackling this quiz this evening, what a rocking
Friday night it will be!
Matt
Humm. OK well fizbuzz could be done as a one linerâŚ
a reasonably readable version of this one looks like 10 lines to meâŚ
yea just tried to shorten it. My version of this one can only
condense down to 2 lines, and I donât wanna spend the time to do more
on it, considering the whole, at work thing
âKyle
On Jul 13, 2007, at 10:56 AM, David C. wrote:
Does it matter?
I think either selection would be acceptable. I would probably favor
the shorter one, but I donât think it matters.
James Edward G. II
On 7/13/07, Sammy L. [email protected] wrote:
solutions arenât as obvious (unless youâve seen it before)
Thank you I felt completely stupid in desperately searching for a
O(n*log n) solutionâŚ
Robert
On Jul 13, 2007, at 1:29 PM, Ari B. wrote:
Being a nub at life, liberty, and ruby, what is the best way to
search it? Would it be to go and sum up the elements in every
possible array (ie, [abc] => [a]. [b]. [c]. [ab]. [bc])? Because
that seems like it would get very CPU consuming with larger arrays.
Letâs have this discussion after the no-spoiler period, please.
James Edward G. II
Being a nub at life, liberty, and ruby, what is the best way to
search it? Would it be to go and sum up the elements in every
possible array (ie, [abc] => [a]. [b]. [c]. [ab]. [bc])? Because that
seems like it would get very CPU consuming with larger arrays.
aRi
--------------------------------------------|
If youâre not living on the edge,
then youâre just wasting space.
Am I missing something, or is this one of the easiest quizzes thatâs
been put forward?
âKyle
On 7/13/07, Kyle S. [email protected] wrote:
yea just tried to shorten it. My version of this one can only
condense down to 2 lines, and I donât wanna spend the time to do more
on it, considering the whole, at work thing
Iâve golfed mine down to a 108-char method body for an exhaustive
searchâŚ
On 7/13/07, David C. [email protected] wrote:
What are the criteria for selecting from multiple possibilities? For example:
[1,2,3,-7,6]
Or this:
[1,2,3,-6,6]
options
[1,2,3]
[1,2,3,-6,6]
[6]