'What is the Big O notation for string.Contains() in GoLang?

strings.Contains(str, substr)
N = len(str)
M = len(substr)

Is
Average case = O(N/2 + M)
Worst case = O(N - M)?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source