我最近有一个面试问题是这样的:
给定一个大字符串(haystack),找到一个子串(针)?
我有点难过想出一个像样的解决方案.
处理此问题的最佳方法是什么,时间复杂度不高?
language-agnostic algorithm
algorithm ×1
language-agnostic ×1