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