SHKSTR problem in editorial

june18
likecs
shkstr
tle
trie

#1

I have used almost the same approach as the online one. Instead of a vector, i just stored the first occurence of the alphabet and another field which told me the index of the first word which ends there.
But, I am getting a TLE for it. Could you help me find why it is happening?
The link to my solution https://www.codechef.com/viewsolution/18809047


#2

Check the while loop in your find method


#3

I think it’s alright because for every node there will exist an end having the same value as frstOcc in the subtree.