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.
Issue resolved. Thanks.
I mean that with O(n^3) complexity, it will time out in some cases. You can try out this input I constructed:
'A'*(250-1)+'X'+'B'*(250-1)+'X'*250+'A'+'Y'*250
. I'm sorry, but your solution actually times out.This problem has n<=1000, but most solutions, including the Sensei's, actually has O(n^3) time complexity, and can be hacked by this input:
match('A'*(250-1)+'X'+'B'*(250-1)+'X'*250+'A'+'Y'*250)
What on earth is this?!
Oops, clicked reply twice, just egnore this one
Thanks for telling me that, I'm new to here, hope that didn't bother you :)
This comment is hidden because it contains spoiler information about the solution
'Cause it's drifting around in outer space, maybe orbiting the earth ;)
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Note that this problem is about number theory, so better not waste time on DP or a greedy algorithm.
(?:RE) is a a non-capturing group that groups RE as a single regular expression. In this problem it's the same as (RE)
This comment is hidden because it contains spoiler information about the solution