2 ms·Horrible Code, Clean Performance1 points by mfiguiere 4y agoeschneider 4y agoInstead of optimizing the naive algorithm, it might make sense to use a faster substring search algorithm like Knuth-Morris-Platt... Forest for the trees.