What is the definition of "neighbor"? I would have thought a neighbor is one immeadiately before or after a particular element.Cris Marinescu wrote:Example1
Input array: `[18, 1, 3, 6, 7, -5]`
Output array: `[1, 3, 6, -5]`
Cris Marinescu wrote:Example1
Input array: `[18, 1, 3, 6, 7, -5]`
Output array: `[1, 3, 6, -5]`
There are three kinds of actuaries: those who can count, and those who can't.
Cris Marinescu wrote:
This is my Test Class
. . .
Can you give me some hints?
There are three kinds of actuaries: those who can count, and those who can't.
Piet Souris wrote:Remember from school: finding all the local extremes on a segment [a, b] also included checking the values at a and b.
I think that should have been specified in the original question.Piet Souris wrote:. . . finding all the local extremes . . . included checking the values at a and b.
I think you are only allowed one pass through the array. Otherwise the whole exercise changes to emptying the array local maxima first.Junilu Lacar wrote:. . . If you remove it, by the same token, wouldn't 7 then become a local maximum? . . .
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |