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.
Correct me if I am wrong but I think this solution doesn't pass the test if we pass an array [2, 5, 32] as the argument. The requirement says that the result needs to return 5 since 5 comes before 32, but this solution returns the number 32.
Wow, this is a clever way to use the send mehtod!!!
I still get the same result if I relace the "===" with the "==". Hence, what is the benefit of using "===" over the "=="? Could somebody enlighten me?
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
So, this is a recursive method right? And when do I know that I should use a recursive method though?
Yes, I also thought the same think. This solution absolutely is using string operation.
This comment is hidden because it contains spoiler information about the solution
ah, I got it. Since everything in ruby is an object. So, if I do self ===, it will be equal to self.===, hence it will call the approriate method for the object self which is a string here. On the other hand, if I do /\A\d\z/.===, it will call "another kind" of === method since the object here is an regex.
Thanks very much, and have a nice day.
wow, I guess your backround is from Java, right? Nice one though. :)
Hi everybody, I don't why I can't pass the test if I do like this:
self === /\A\d\z/
I think they are the same solution, right?
Wow, you are really serious about helping other people. Your explaination should get more voted. Thank you very much, I have learned something new from it. Keep doing the good work, and have a nice day. :)
This comment is hidden because it contains spoiler information about the solution
This is why I love ruby. :))
wow, this is so clever! :))
Loading more items...