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.
You may be right, but I like to avoid boilerplate whenever possible. In my opinion it enhances readability to use situational syntactic sugar like this: because it can only be used in certain circumstances, its use highlights that you are in those circumstances.
Example tests are already there, you have to deduce the logic on your own though
Perfectly servicable and efficient. Wouldn't best practices encourage adding a
return
line? Obviously not necessary for such simple code.You've wrote a great elegant solution but it's very unclear. I spend half a day to understand what your code actually does. It is the case where comments are absolutely necessary
That's some trolling indeed
Smart way to do recursive function in R, thanks a lot.
It's a great feature of R ;)
Love the check for zero using conversion to logical!
Yeah that's very confusing.
beautiful work
Why do people for this as best practice?
You can already see that in the example in the description.
The description needs to address how to handle 0, that knowledge is obviously required to pass the tests.
Oh well.
You're right, but the kata description explicitly says "It is guaranteed that a and b are both present in arr", so for this specific task this does the trick.
Loading more items...