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.
Until this kata I didn't know there is a magic called "isAsciiLower" / "isAsciiUpper". 😂
Your solution is very readable. Nice trick on
+ ord 'a'
Hi, I'm the original author of this Kata (Ruby version). Author of the haskell version didn't understand this Kata properly, and indeed added a DFS version instead of BFS.
I have learned haskell to fix this. I added a BFS solution and a correct buildTree (thanks to @nickie for providing one). Please take a look again.
Thanks,
Karol
To the question "When is the right time to refactor?", I would answer "Always.".
Yep, spent an hour on this until I realized that the test was broken. The test is written for pre-order traversal, not level order traversal.
Here's a
buildTree
that does correctly builds full binary trees out of lists in O(n).Please, whoever introduced the Haskell version of this kata, let's fix this!
Ugh, that's why. I didn't want to bother debugging, but this is frustrating.
Yeah, but I realise now I could have simply used
fmap
.Second is from Arrow.
@pcapriotti
That should have been totally obvious! Thanks for putting it straight.
For some reason, I wanted to see how totality would break Lambek's Lemma... but that was clearly the wrong tree to be climbing.
Looks fine to me !
The test involving
sum
was replaced withThere is now
to
in the solution skeleton, but I can't reset the provided tests, so I can't check if it's in there too :(Ah, thank you! That is a bug. I forgot to track the public test cases to the behind-the-scenes ones.
It should be fixed now, please let me know if you find any remnants. Thanks!
Not sure if the changes are supposed to be atomic, but the "commit" button does require
to
, and it's not in the default solution or test cases as far as I can see.Loading more items...