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.
it works because you return early if you find the result, otherwise the methods last line is return nil
Shouldn't we care about like "ssd:)" as NOT smiley face?
@gaael use spoiler flag next time, your post is visible in the homepage otherwise.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Not surprised that the best solution contains a regex.
hey! could someone please explain how this works to me please? Thanks
it's the iteration limit.
This comment is hidden because it contains spoiler information about the solution
If the code runs correctly, it will return said pair and end execution. If it doesn't find the pair, it will continue running until it finds this "return nil" statement. In this case, the description specifies you should return nil when no pair is found, so this does right that.
Hope I was of help.
can someone explain why does "return nil" work here?