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.
@voyxxx Did you mean 'fewer'?
It might depend on the regular expression engine, but I'd imagine a fixed-width look-around can be optimized to some extent; and I think I've run into it where engines don't support variable-width look-around. Only engine I've really looked at code for is Python's and all the goto statements in there make it pretty hard to follow. What I learned there is that you can avoid regular expression DOS with system interrupts using Python's regular expression engine.
@voyxxx, What do you mean? This algorithm traverses the array less then 2 times. Is that to much?
But it's so easy to read.
nice thank you for the tip @voyxxx!
You but it is hardcore the solution
do you mean this part
(0*)
of the regex?, he/she is grouping here the part w/ zeros, I think it's clever, in a good sense, don't you think so?, or am I missing something?This should be solve with O(1) and it is not 5kyu consider the complex Math you have to make here.
This comment is hidden because it contains spoiler information about the solution
Is this brute force? What's the time complexity of this solution? Anyone?
... and then the guy from the refactoring team left the company. THE END.
This one should be the most voted. Clean and simple solution.
This comment is hidden because it contains spoiler information about the solution
Ths is hardcoding the solution
And why you don't use the spoiler flag?
Loading more items...