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.
Good job, I voted for clever too.
I like this with recursivity
I voted for clever, because this scales with the interval lengths, not the count of the intervals. So if you want to have large intervals, this can be slow:
echo sum_intervals([[0, 40000000]]);
Yet readability is A+ :)
wow, this is another level. it's crazy to think the amount of "ifs" that I used and this could have been solved more simply
wtf i did the same at first, but it didnt work :(
I think it's easier to find ending Exclamation marks themselves using preg_match rather than remove all symbols except ending Exclamation marks using preg_replace
The rating of this solution shows how the developers tend to ignore the description in favor of a solution with less lines.
I think this solution is fit perfect for given description. The only one thing which I would correct is implode($arr). There is no need in delimiter at all.
Unnecessary 'else' in code.
if (blabla){
return 'blablabla';
}
return 'another blabla';
I need to utilize ternary operators more. Thanks for this solution!