CHEFSHIP - Editorial

Can you please include the KMP solution? I am not getting it.

8 Likes

If we reduce the time limit for python, usko nani yaad ayegi :laughing:

2 Likes

I am just a noob so please don’t take it seriously…:slightly_smiling_face:

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).

2 Likes

Hi all,

Test cases are updated. We can’t rejudge the contest solutions but in practice, you will have new test cases.

14 Likes

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

1 Like

what will happen now

I used substr() and it passed. Check my submission.

2 Likes

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.

5 Likes

And many people have passed n^2 so better rejudge it

1 Like

@rishup_nitdgp can you please explain in which scenario this statement will execute ??

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.

1 Like

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