- Time : O(size(small) * big.length + sum(all(small.length)))
- Space : O(max(small.length))
1 | // kmp solution |
- Time : O(max(small.length) * big.length + sum(all(small.length)))
- Space : O(sum(all(small.length)))
1 | // trie solution |
1 | // kmp solution |
1 | // trie solution |