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 issue is fixed. the reference solution performs a marshalling/unmarshalling on the tree, effectively making a deep copy. the reference solution is also called before the user's
expectedandactualmust have been flipped at some point. the OP returnsnilinstead of{:depth=>0}for{}Nice kata of the dynamic programming series.
Thi stest doesn't make sense:
Empty or invalid input:
Inputting an empty hash
should return a hash with a depth of 0
Expected: nil, instead got: {:depth=>0}
How it should return a Hash and expect a nil in the test?
Passes that test now. Cool. Thanks so much.
I've just checked the description and this particular test indeed contradicted it. Reset the trainer and try your code again.
I can't see the tests. When I write the test according to the demands in the instructions, it's correct. There's no indication about how the input object should be modified. I'm left guessing what the issue could be.
What's wrong? How should it be tweaked? Why? All tests are correct, and expect you to modify the input object.
This comment is hidden because it contains spoiler information about the solution
fixed by modifying the input object
[JS]
for test "handles deeply nested objects"
my output is
but I got
Wrong deepest depth - Expected: 11, instead got: undefined
why?
could also use tree.constructor === Object
the 'typeof' output for [] is 'object' in ES6 which seems to make things hard...
I had to modify the original JS object to get the tests to pass.
I thought that was really bizarre. So bizarre that I couldn't tell why my solution wasn't working properly at first.
I don't see any modification to the tests. did you update them or not?
Loading more items...