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 cannot pass "random tests: treeToParens inverts parensToTrees"
In expected parens I can find cases where there are 3 or more siblings for example
()()()
.How can I transform this in
Branch
structure if I have onlyleft
andright
branhces available?I suspect tests are not as discriminating as you intended. I used
(Eq k) =>
and got away with it.I love this kata! I created a C translation. Please have a look and let me know what you think. :-)
I had to use different data structures, but I tried to stay close to the basic idea as exemplified by Haskell.
I also changed the description because some of it was only relevant for Haskell, but I used languag-conditional rendering to make sure that the specific parts are still shown when the user is looking at the Haskell version.
I am sorry if it's my Haskell ineptitude getting in the way again, but is order strictly defined for
Data.Tree
?