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.
freaking genius
A bit late, but you can use something like a
std::sync::atomic::AtomicU16
or just astatic mut u16
as like a question counter, and then just return false when that counter hits a certain value.The only slight issue is that Rust tests are run in parallel, but I'm assuming only one of the test categories are timing out, so this should be fine.
I fixed it.
Now, the order should no longer be predictable.
Fixed.
I added the missing parentheses, now it should be correct.
This comment is hidden because it contains spoiler information about the solution
Is the to_string method correct?
is printed as
"a|b*"
, but surely it should be"(a|b)*"
?Yes, random tests sometimes generate weird regexes, but that is supposed to happen.
If it is needed, I could simplify the regexes after generating it, but I don't think it is really needed. After all, the solution should work for any regex and while some of the generated regexes might look odd, they are still valid regexes that should be tested as well.
To me, the fact that such regexes are generated by random tests is not a problem and it is supposed to happen.
Thanks for the suggestion! Unfortunately, this doesn't appear to work for me. I was previously writing to stderr unbuffered, but writing to stdout and flushing also appears to produce no output. (And to be clear, I'm writing the inputs out immediately upon the function call, not after doing any sort of processing.)
I suspect there isn't much I can do here.
There are some unwieldly regex fragments being generated by the random tests, like
e??*
(which is juste*
). Is this intended?(At least it's not generating something like
e**
as far as I can tell...)I've passed all of the unit tests, but it appears that the random tests are timing out for me. AFAICT, there's no way to find out which specific test data is causing the timeout, right? I tried logging test cases to stderr, but it appears that when a test times out, Codewars just won't show the log for that test, unless I'm missing something. (When I explicitly fail a test, I do have the option to expand the log.)
Certainly a fault of my algorithm, but it's hard to know what to benchmark without having solid examples (which are otherwise difficult to generate by hand). I'd love to be able to time profile a known failing test, because I really enjoyed working on this kata and I'd love to complete it.
lol, why
o__O
hhhh seriously which language is this now?
I recently watches a video where one guy explained this in details :D I'm amazed to see this again, gj :D
Loading more items...