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 doesn't make any sense without any context. A string neither does nor does not end with no-one-knows-what. Returning a value is just hiding an error that someone (maybe you) will have to find one day when something weird happens because of it.
?
It's handled the same way as a
null
str
.It is handled: an exception is thrown. How else would you handle that?
@dinglemouse: Thanks for your explanations and comments.
On the contrary, this Kata is very precisely worded:
Your task is to return the first longest string consisting of k consecutive strings taken in the array.
k
)One can't say it simpler:
In other words construct all strings constitued of k consecutive (following one another) strings of the array and return the first which has the longest length.