Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.
class Solution {
public int strStr(String haystack, String needle) {
if (haystack.length() < 0)
return -1;
if (needle.length() == 0)
return 0;
int j = 0;
for (int i = 0; i < haystack.