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.
+1 for no one wants to deal with that regex. But I imagine plenty of people wondered how it would be done.
Thank you this code is very helpful specially on String manipulation.
I have learned that in the split method I can use regex on it and The \G
Cool solution an much better than my own, but in no way is that "best practice".
I wonder if regexes are considered "best practice" when there is a comparably easy to read
for loop
based answer?Correct me if I am wrong: the String.split will find the pattern, remove it and keep left and right side.
So every 2 chars, split will remove pattern, keep left side (just got removed) and right side.
The trick here is that thanks to the capturing groups (?<=) + \G, pattern is reinserted(?) or pattern becomes "what's in between 2 chars" (?).
Still trying to figure it out.
This comment is hidden because it contains spoiler information about the solution
That's a good idea.
how beautiful it is
Good ;)