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.
No worries, it happens to everyone at some point!
Well this is embarassing. That's exactly what happened. Thanks for your responses! :)
Are you sure that the
0 should equal 1
isn't referencing the test above the one that you're talking about? The input for that test is[1,0,0]
and the correct answer for that test is indeed1
.The
x should equal y
will appear below the log for any test that you fail, not above it.Haha it's always possible that I'm misreading it, but I don't think that's what's happening this time (I apologize if I am lol - and further, the numbers, as you point out, seem pretty convincing, so it wouldn't surprise me if I'm wrong). I added some code to print out relevant info and pasted the result below.
0 should equal 1
Log
input is: [3, 7, -99, 81, 90211, 0, 7]
solution is: 0
solution's type is: <class 'int'>
Your solution can run into issues when the array contains duplicate values. I'll let you figure out why that might be exactly. I would also suggest maybe taking a different approach altogether. Not to be mean, but 3 nested loops are probably not the best solution to this problem.
That particular test case is a fixed one, and not random. I can confirm that this test actually expects
0
to be returned, and not1
. Is it possible you're reading the test result incorrectly? I checked in python, not sure about the other languages. Python also has almost 42,000 solves, so I'm guessing the problem isn't with the tests.I apologize if this is the wrong area to post this - I'll redirect if needed. After clicking attempt, the following test case failed: [3, 7, -99, 81, 90211, 0, 7]. My solution suggested the answer is 0, which is in fact the correct solution. The test case expected 1 for the solution. So whatever generates the tests isn't working perfectly.