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.
Is there someone I can ask about how this works? It's one of the few katas I've skipped over and want to gain an understanding for it. I can read how the hashes translate over, but I'm unfamiliar with the rest of the code.
Im getting better, I did the same!
I like your solution because it'll be easier to maintain in the future.
Any reason you wouldn't want to throw the needed methods into a constant array (like in my solution)? That way, it doesn't create that array every time you call the method ...
http://stackoverflow.com/questions/6337897/what-is-the-colon-operator-in-ruby
This describes why should one use the colon operator
aha, this is exactly is my code.
The internets melt down :D
what if the search_text is a space char?
It's not wrong, re-read the code more carefully ;-)
this solution is wrong if full_text == search_text or full_text end with search_text
1.9.3-p392 :042 > "vv".split("vv").size
=> 0
1.9.3-p392 :043 > "vvaa".split("vv").size
=> 2
1.9.3-p392 :044 > "aavv".split("vv").size
=> 1
Dang, forgot about .last, that [0..2] bothered me