Can you please include the KMP solution? I am not getting it.
If we reduce the time limit for python, usko nani yaad ayegi
I am just a noob so please don’t take it seriously…
I tried with kmp just like setter’s solution .Not getting how to remove overlapping length of lps .can you please elaborate a liitle about if(2*len > i+1) @rishup_nitdgp please.
{len = lps1[key][len - 1];}
Chill dude. The only problem is that bruteforce works in python (which shouldn’t happen).
Hi all,
Test cases are updated. We can’t rejudge the contest solutions but in practice, you will have new test cases.
I dont know how brute force n^2 soln get passed in the contest .
i have seen many people code passed in n^2.
#weak test case
what will happen now
I used substr() and it passed. Check my submission.
Can anyone please tell me why this solution is wrong?
My solution-CodeChef: Practical coding for everyone
Can you share the link to your code?
Bro can you tell where i am getting wrong?
My suggestions would be to make strong testcases. This is serious issue please take care next time.
That’s why cf is better.
And many people have passed n^2 so better rejudge it
Hello, this is very good. I used a n^2 brute force method and got runtime error. I am not very familiar with rolling-hashes and want to learn. Would it be possible if you commented your Hashing class in the answer key? That would be extremely helpful, Thank you so much.
Naive string matching with brute force will exceed the time limit right?anyone?
Can anyone tell me what’s wrong in my code? I am getting Wrong Answer Verdict everytime.
LINK:
https://www.codechef.com/viewsolution/33307144
Why do we require to compute lsp1[0] and lsp1[1],can u please elaborate litttle