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.
I had a very similar solution to you. I really like pop because it returns the removed value. It was perfect for this kata. Cheers
This one was really fun!
My final solution.
Congrats!
I DID IT! Holy cow! That was hard... That felt really good hitting the test button for the 100th time and seeing all green. Wow..
'This is because of the condition "if the incorrect value occurs on the leaf level, then the right child will always be the incorrect one." Since 9 + 1 != 16, the 1 must be changed to 7, rather than changing the 9 to 15.'
{19, 9, 10, 4, 5, 4, 6, 3, 2, 1, 4, 1, 3, 2, 4} answer - [3,5] incorect parents.
But!
{29, 13, 16, 5, 8, 9, 1} answer - [6.7] ! incorect leaf.
Absolutly equal case give different results?
I'm sorry, i'm not understand.
6 kyu? Really?!. ;/
The tree looks as follows:
So the error is either the 9 or the 1 and both are leaves. The description states to take the right leaf in such case.
No, you cannot suppress the default assertion message but your solution with the custom message is fine.
O_o
the picture confused me - the root is at the top and the leaves are at the bottom ...
I dont think that this kata is 6 kyu, it should be placed in minimum 5 kyu.
I have modified the description to make this clearer.
I created custom error messages. But I'm still getting the default as well, so now it says:
Expected [6, 7], Received [1, 13] ==> array contents differ at index [0], expected: <6> but was: <1>.
I suppose that's okay, but is there any way to suppress the part "==> array contents differ at index [0], expected: <6> but was: <1>."?
Yes, I disagree. There are overloads of assertion methods that take a string, which you can / should use to display the input.
Loading more items...