Ad
  • Custom User Avatar

    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

  • Custom User Avatar

    expected and actual must have been flipped at some point. the OP returns nil instead of {:depth=>0} for {}

  • Custom User Avatar

    Nice kata of the dynamic programming series.

  • Custom User Avatar

    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?

  • Custom User Avatar

    Passes that test now. Cool. Thanks so much.

  • Custom User Avatar

    I've just checked the description and this particular test indeed contradicted it. Reset the trainer and try your code again.

  • Custom User Avatar

    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.

  • Custom User Avatar

    I think the JavaScript tests should be tweaked. There's a few questions about it. Coders have to mess with it in order to get it to pass.

    What's wrong? How should it be tweaked? Why? All tests are correct, and expect you to modify the input object.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    fixed by modifying the input object

  • Custom User Avatar

    [JS]

    for test "handles deeply nested objects"
    my output is

    {"a1":1,"a2":2,"a":{"b":{"c":{"d":{"e":{"f":{"g":{"h":{"i":{"j":{"k":{"depth":11},"depth":10},"depth":9},"depth":8},"depth":7},"depth":6},"depth":5},"depth":4},"depth":3},"depth":2},"depth":1},"depth":0}
    

    but I got

    Wrong deepest depth - Expected: 11, instead got: undefined

    why?

  • Custom User Avatar

    could also use tree.constructor === Object

  • Custom User Avatar

    the 'typeof' output for [] is 'object' in ES6 which seems to make things hard...

  • Custom User Avatar

    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.

  • Custom User Avatar

    I don't see any modification to the tests. did you update them or not?

  • Loading more items...