Implement strStr()
EasyAcceptance Rate 37.8%
Implement strStr(). Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.
Examples
Example 1
Input
haystack = "hello", needle = "ll"
Output
2
Constraints
0 <= haystack.length, needle.length <= 5 * 10^4haystack and needle consist of only lower-case English characters.