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 the same issue while reading at first
I misinterpreted the instructions. I thought we were supposed to get the values from each level, sort them, and then put the levels in order, this way the values in each level of the tree would be sorted as opposed to being in the same order they were in the tree. The examples given and the sample tests did not rule out this interpretation.
Great Kata!
How am i supposed to import this "preloaded" module from rust into my working ide? I can't find it anywhere.
ok it's been corrected.
can't test in the python version, there is a typo in the test:
impo.assert_equals(tree_by_levels(None), [])
^^^^
test.assert_equals(tree_by_levels(Node(Node(None, Node(None, None, 4), 2), Node(Node(None, None, 5), Node(None, None, 6), 3), 1)), [1, 2, 3, 4, 5, 6])
this is because the
Node
type inpreloaded.rs
on Codewars does not#[derive(Clone)]
, unlike the one you wrote on your own machine; see thisthis is not really a kata issue, you don't need to make copies of the nodes, you can manipulate them through references
Nice kata:D
Sorry if I'm wrong but it seems to me that, in the Ruby version, the TreeNode definition (with the attribut "value" marked as "attr_reader" without an initialize method to assign it) doesn't permit to the buildTree function to work. Does it ?
This comment is hidden because it contains spoiler information about the solution
CoffeeScript translation
It appears I was mistaken, upon further analysis, you're correct, I was just misinterpreting the results I was getting, sorry!
They don't. All the tests follow the same pattern.
If that's the case, then why do some of the random tests follow a different pattern?
Loading more items...