public List<Integer> findSubstring(String S, String[] L) {
		List<Integer> list = new LinkedList<>();
		if (S == null || L == null)
			return list;
		Map<String, Integer> covered = new HashMap<String, Integer>();
		ArrayList<Integer> res = new ArrayList<Integer>();
		int wordlength = L[0].length();
		int wordnum = L.length;
		for (int j = 0; j < wordnum; j++) {
			if (covered.containsKey(L[j])) {
				covered.put(L[j], covered.get(L[j]) + 1);
			} else {
				covered.put(L[j], 1);
			}
		}
		
		for (int i = 0; i + wordlength * wordnum <= S.length(); i++) {
			Map<String, Integer> temp = new HashMap<String, Integer>(covered);
			for (int j = 0; j < wordnum; j++) {
				String testStr = S.substring(i + j * wordlength, i + (j + 1) * wordlength);
				if (temp.containsKey(testStr)) {
					if (temp.get(testStr) - 1 == 0)
						temp.remove(testStr);
					else
						temp.put(testStr, temp.get(testStr) - 1);
				} else
					break;
			}
			if (temp.size() == 0)
				res.add(i);
		}
		return res;
	}