R
R
russabirov19982015-12-29 12:36:22
Python
russabirov1998, 2015-12-29 12:36:22

How fast is the standard substring search in a string in Python?

s = ... #строка
text = ... #строка
if s in text:
    ...

How fast is Python's standard substring search in a string (s in text)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey K, 2015-12-29
@mututunus

O(nm) - worst case.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question