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.
Why not do away with the
if
entirely and writen.left and queue.append(n.left)
? That might be obfuscation though, depending on who you ask.This comment is hidden because it contains spoiler information about the solution
Me either, was expecting a clever mathematical trick ¯_(ツ)_/¯
Should be ok now. Thanks for reporting!
This comment is hidden because it contains spoiler information about the solution
Yeah man. Pattern matching is a great feature.
Very clever way of checking if the list is size one. You could also destructure x and y as (x:xs) and (y:ys), in which case you can check whether xs or ys is null.
Thank you!
Thank you!
This comment is hidden because it contains spoiler information about the solution
The reference solution checks for equality, so I'm pretty sure the tests are sound.
The thing is, most shifts other than the correct shift will not produce words. Therefore if your solution can get most of the words, it will succeed. To me, this is normal behavior.
Why so many random tests?
Thank you both! My math background is a little spotty, sometimes simple stuff flies right over my head...!
I've rewritten the solution again.
Note that the answer in your example is actually 22 : you forgot to count a 'v'.
This comment is hidden because it contains spoiler information about the solution
Loading more items...