educative.io

Educative

O (n + m) solution

I understand that DP solution is helpful to understand/solve derived problems, but this problem has a suffix tree solution, which is way faster - O(n + m). It would be good if you mention that somewhere.

1 Like