WSITES01 - Editorial

I was actually about to ask you on mail on how you did it. I always look forward to @meoow and your solutions on any problem :smiley:

I’m pretty sure many people solved it using hashing too.(I’m one of them)

3 Likes

Well yes 2 pointer, binary search, hashing all are basically searching ways. So, my point was just that there were easier ways than tries.

1 Like

There you go :slight_smile:

I am using some help from the Java collections. I don’t know why I am getting WA in only 2 of test cases.
Can somebody help me?
Link to my answer: https://www.codechef.com/viewsolution/13641286

Try this-

Input 1: 
    4
    - codechef
    - coded
    + coder
    + codechefu

Input 2:

    3
    - codechef
    - coded
    + codechefu

Expected output is -1 for both, your program doesnt print that.

Thanks @vijju123

Yes. This editorial only has editorialist’s solution at the moment.

@vicennial Why did u choose

int p=31; for calculating

ans=(ans*p+(i-‘a’+2))%MOD;