private static int[] snippet(String[] qs, String p, int[] inds, int i) {
		if (inds.length != 2)
			return null;

		String [] ms = helper(qs, p);
		if (ms == null || ms.length == 0) {
			inds[0] = -1;
			return inds;
		}

		if (i < 0)
		{
			i = 0;
			inds[0] = p.indexOf(ms[0]);
		}
		// last case
		if (qs.length == 1) {
			int minlen = Integer.MAX_VALUE;
			for (String m : ms) if (m.length() < minlen) minlen = m.length(); 
			inds[1] = i + p.indexOf(ms[0]) + minlen;
			return inds;
		}

		int minlen = Integer.MAX_VALUE;
		int[] ret = null;
		for (String m : ms) {
			int ind = p.indexOf(m);
			int[] mm = snippet(remove(qs,m), p.substring(ind+m.length()), inds, i + ind + m.length());
			int len = mm[1] - mm[0];
			if (minlen > len) {
				minlen = len;
				ret = mm;
			}
		}
		return ret;
	}