15. Find the Index of the First Occurrence in a String
Given strings haystack and needle, return the index of the first occurrence of needle in haystack, or -1 if it is not present.
範例 1:
輸入: haystack = "sadbutsad", needle = "sad" 輸出: 0
範例 2:
輸入: haystack = "leetcode", needle = "leeto" 輸出: -1
限制條件:
1 <= haystack.length, needle.length <= 10^4