Implement strStr().
Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.
Subscribe to see which companies asked this question
public class Solution {
public int strStr(String haystack, String needle) {
int x = haystack.indexOf(needle);
return x;
}
}