- Time:O((m - n)n), where m = |\texttt{haystack}| and n = |\texttt{needle}|
- Space:O(1)
C++ |
---|
|
JAVA |
---|
|
Python |
---|
|
C++ |
---|
|
JAVA |
---|
|
Python |
---|
|