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.
The description clearly states: " numbers starting with 1". So, if the list does not start with 1, but is ordered anyhow, then the smallest missing number is 1.
It's the same result as for invalid lists, but that's as requested.
Same here, pretty frustrating as it took me quite a while to find the effecient solution.
Sure, I guess that was pretty stupid of me. Still, doesn't hurt to give your tests a proper name or description.
I think everyone can print the input...
test 8 ,array a has negative number
The requirements for this one are VERY unclear. Should a direction only be reduced when the opposites are found next to each other? It's not very clear based on the desciption at all, and it's just a silly way to handle the problem. The title of the Kata is even "How I crossed the deser the smart way", yet you want us to walk in circles?
No, just... no :)
I liked it somewhat, but the large amout of tedious pre-conditions you have to check is annoying. Also, you should probably state more clearly that the length of the arrays can start at something higher than 1, because all the examples and tests do.
I just managed to pass the test by adding some random System.out.println's. Removing them made the test fail again. No clue whats going on.
Can anyone supply some input on the 8th test case in Java? I can't seem to pass it, and I have no idea what is actually being tested in that test.
It's probably misleading. The test case that is written for us states:
assertEquals(AreSame.comp(a, b), true);
But assertEquals actually takes the first argument as Expected, and the second argument as Actual. So it should be like this:
assertEquals(true, AreSame.comp(a, b));
In that case, the reply makes more sense I think :)
However, I'm unable to pass the 8th test in Java as well.
In Java, you should either make seperate test methods for each assert or you should give them a proper description. Stuff like
it should return false
does not help at all.This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
I seem to have some trouble understanding the failing test cases:
testFirstElementMissing -> "It must return 1 for a sequence missing the first element". What does that mean? The description clearly states that it should return 1 only when the sequence is invalid (it contains a string with non numeric character). Also, what is the "the first element"? If the sequence is missing the first element, does that mean it is "empty"? Because the description says we should return 0 in that case.
testShuffledInput -> "It must work for a shuffled input (expected 1)". I don't understand this either. You have written a test that checks if we can handle shuffled (I assume this means unsorted) input. However, you have written this test so that it expects 1, a result which is reserved for a sequence containing invalid characters. Surely if that is the expected result, you can't expect the input to be sortable?