CHEFSHIP timelimit exceed plez help

https://www.codechef.com/viewsolution/33795921

Your hash function is O(N). It’s not better than just comparing it directly.
https://cp-algorithms.com/string/string-hashing.html

1 Like

thanks for reply.