Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. What should we return when needle is an empty string? This is a great question to ask during an ...
- 1. 当B是“”的时候,也就是能在A的其实位置找到B....index = 0. - 2. edge condition: 如果 haystack.length() < needle.length() 的话, 必须错 ...