strstr O(m*n), in Java