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.
simplicity at its core
because it complicates the code in that way you know that it takes more time for the memory to execute
This comment is hidden because it contains spoiler information about the solution
it so cool..
This is why I joined this site. PHP is such a powerful language. I have never even heard of this function and here it is, making this problem a one liner. Well done.
This.... is genius.
Dude, That is why I hate/love codewars...
I created a whole freakinĀ“ algorithm to solve this, but there was a simple function that could do it already. Hahaha!
Nonetheless, we salute you!
props
No need to handle double spaces.
The regular expression
(WUB)+
does not matchWUB
but as many as possible consecutivesWUB
(because of+
).For example, in the string
STARTWUBWUBWUBBEND
, a unique match is detected (WUBWUBWUB
) and replaced by a unique space.Hope this helps.
Thanks!
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
mantap