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.
the Link was updated to https://blog.ostermiller.org/finding-a-loop-in-a-singly-linked-list/
pretty slick way of forcing a string!
This script has a good balance of speed and its clean to read. Nice work.
My mind was blown away with "Catch Loops in Two Passes" approach! How elegant.
Great article, yep, I did use the last one. Since there is a tail before the loop, I need to call the method twice.
You have forgotten that one can use recursion!
Returning
nil
from a method which clearly should return eitherfalse
ortrue
can lead to bugs. E.g.alphanumeric?(s) == false
wouldn't work as expected.Cheats ;D
Nice and a different solution!
But everything other than nil and false are truthy in Ruby. There's no need to do an explicit boolean conversion.
This comment is hidden because it contains spoiler information about the solution
Nice one regexp solution!
This comment is hidden because it contains spoiler information about the solution
True coffeescript solution!
Nice solution.
Loading more items...