public String minWindow(String S, String T) {

        winDeque = new LinkedList<Character>();
        tMap = new HashMap<Character, Integer>();
        cMap = new HashMap<Character, Integer>();
        minWindow = null;
        fill = false;

        for (int i = 0; i < T.length(); i++) {
            Character currentC = T.charAt(i);
            if (!tMap.containsKey(currentC))
                tMap.put(currentC, 1);
            else
                tMap.put(currentC, tMap.get(currentC) + 1);
        }

        for (int i = 0; i < S.length(); i++) {
            Character currentC = S.charAt(i);
            winDeque.offer(currentC);
            if (tMap.containsKey(currentC)) {
                Integer tmp = cMap.get(currentC);
                cMap.put(currentC, tmp == null ? 1 : tmp + 1);
                if (fill())
                    tryPop();
            }
        }

        return minWindow == null ? "" : minWindow;
    }