Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
There is a problem wtih the test case: "The array was: [-1,1,0,-1,1,0,-1,1,0,0]: expected +0 to equal 2". Because the first index meeting the requirements is 0 but it expects to return the second satisfying index.
There is a problem wtih the test case: "The array was: [-1,1,0,-1,1,0,-1,1,0,0]: expected +0 to equal 2". Because the first index meeting the requirements is 0 but it expects to return the second satisfying index.
Fixed. Remember mentioning the language.
There seems to be a bad test case.
It failed on the array of: { 7, 3, 3 }
It expects an answer of 0, but there is no answer, so it is -1.
However, in the 'printed' test case, it shows { 7, 3, -3 }, which DOES give an answer of 0, so I think there may be a typo in the test case, where one of the threes is missing a negative sign.
NVM I read wrong: The test is telling my code is failing because for {8,8} should give me -1 and it's giving me 1 (which is totally wrong)...
Sorry ^^;
Hi there, I am having doubts about Length 2 sized arrays.
When n=0, there is nothing at the left (because there is no -1 position), so the answer should be 1 if position 1 equals to 0.
When n=1, there is something at the left (position 0) and nothing to the right (last position), so the answer should be 0 if position 0 equals to 0.
So I don't understand why {8,8} should be 1! I mean, n is not being counted, but the numbers at the left and at the right of n, isn't it?
Am I misreading something or missing something?
Java:
camelCase
, notPascalCase
Refer here on how to enable backward compatability to not invalidate all solutions
Reraised as an issue :-)
great job !!
@Awesome A.D.: thanks for the tip about printing during the test phase...it's a good thing to know (which I did not). Big thumb's up!
python, maybe others: there should be a fixed test for
0
done
Awesome, works like a charm now, thanks!
Ruby:
Loading more items...