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.
Very nice solution!
\b
matches word boundaries.This is great. So I understand
.scan
, I think. But what is the \b on BOTH sides for?Ummmm wow.
pattern between // is a regular expression pattern that matches on to the string object.
in this case the pattern is 0*$ which is:
0 - is the character 0
* - is whats called quntifer, it stating how many times should the character on the
left side of it should be counted. * - zero or more times.
$ - stating that that you want to match to th end of the current string.
VERY clever...
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
VERY clever. Nice job
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
How in the hell does this work?!?
This is great. Would you mind explaining to me how this works? More specifically, I'm looking at the 'return index if yield item'. So I get the 'return index' part, but 'yield item' is what's tripping me up. You're saying 'yield' or stop if 'item' shows up?
This comment is hidden because it contains spoiler information about the solution
Since the two arguments are both booleans we can use them directly when comparing. This solution asks if I'm
employed
and (&&
) not (!
) onvacation
. Since this is Ruby, the last executed line in a method is automatically returned.Loading more items...