public String strStr_BAD(String haystack, String needle) {

    if (haystack.length() < needle.length()) {
      return null;
    }
    if (needle.isEmpty()) {
      return haystack;
    }

    // here used a little pruning trick to get ACed
    int i;
    outer: for (i = 0 ; i <= haystack.length() - needle.length() ; i++) {
      int iTemp = i;
      for (int j = 0 ; j < needle.length() ; j++) {
        if (iTemp < haystack.length() && needle.charAt(j) == haystack.charAt(iTemp)) {
          iTemp++;
        } else {
          break;
        }

        if (j == needle.length() - 1) {
          // return needle;
          break outer;
        }
      }
    }

    if (i > haystack.length() - needle.length()) {
      return null;
    }
    return haystack.substring(i);
  }