Ad
  • Custom User Avatar

    Have you actually tried printing what that solution returns? Why do you assume the test is broken? there are over 700 passed solutions to this. Wouldn't it make more sense to assume it's your solution that is broken?

    Try building a tree provided as an example, and see if your solution prints the expected output.

    Hint: the result of a function in ruby is the last expression in it. in your case, it's

    sort_tree(node.right, acc)
    

    Do you think that call will return the expected call?