What is the best way to match a string or part of a string in C language ? It could be whole string or such as "develop" took from "development". I used to solve this problem with some loops, but it getting TLE for large size in Length. Which way would be efficient ?
Thanks
KMP (Knuth-Morris-Pratt algorithm) and Rabin-Karp algorithm.
If I'm not wrong, it's Rabin-Karp?
Yes it is, sorry I misspelled.
I have once got AC with just
strstr
function in the problem where KMP was expected. Try it out.