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.
When I tried to solve it, I thought that it is worth a 4 or even a 3 kyu difficulty badge, but once I succeeded, I think this is something between 5 and 4. There are some easier 4 kyu problems than this, but also there are more difficult 5 kyu problems out there IMHO.
Great kata by the way, thanks. It was fun to solve.
Your enconding should transform the input string "()()()" to a binary tree and that will solve the problem. It is an assumption bias that "()()" encodes something that has 2 branches, so "()()()" should encode something with 3 branches.
This comment is hidden because it contains spoiler information about the solution
Happened to me as well. I got an "inc x 0" instruction. My pattern matching is now uglier, because I had to prepare recognizing syntactically incorrect lines.
Thank you. :)
Modified, thanks.
This is perfectly ok, obviously, this does not make solving the problem impossible. What I would like to say is if this is intentional (as it appears to be) than this should be stated in the problem description: "It is guaranteed that the weight array is at least as long as the number of names" or similar. There is no public test case that would call attention to this possibility.
It is not a problem; all you need is that the length of the weights is longer or equal to the length of the names so you can apply a weight to the corresponding name.
This comment is hidden because it contains spoiler information about the solution