You are given two strings, haystack and needle. Find the first place where needle appears inside haystack.
Return the index (counting from 0) where it starts. If needle does not appear in haystack, return -1.
Examples
Example 1:
Input: haystack = "mumbaimetro", needle = "metro"
Output: 6
Explanation: "metro" starts at index 6.
Example 2:
Input: haystack = "banana", needle = "nab"
Output: -1
Explanation: "nab" does not appear anywhere in "banana".
Example 3:
Input: haystack = "aaaab", needle = "aab"
Output: 2
Explanation: The first "a" at index 0 starts "aaa", which fails. The match starts at index 2.