Java solution. using two pointers + HashMap
public class Solution {\n    public String minWindow(String s, String t) {\n        if(s == null || s.length() < t.length() || s.length() == 0){\n            re
    public class Solution {\n    public String minWindow(String s, String t) {\n        if(s == null || s.length() < t.length() || s.length() == 0){\n            return "";\n        }\n        HashMap<Character,Integer> map = new HashMap<Character,Integer>();\n        for(char c : t.toCharArray()){\n            if(map.containsKey(c)){\n                map.put(c,map.get(c)+1);\n            }else{\n                map.put(c,1);\n            }\n        }\n        int left = 0;\n        int minLeft = 0;\n        int minLen = s.length()+1;\n        int count = 0;\n        for(int right = 0; right < s.length(); right++){\n            if(map.containsKey(s.charAt(right))){\n                map.put(s.charAt(right),map.get(s.charAt(right))-1);\n                if(map.get(s.charAt(right)) >= 0){\n                    count ++;\n                }\n                while(count == t.length()){\n                    if(right-left+1 < minLen){\n                        minLeft = left;\n                        minLen = right-left+1;\n                    }\n                    if(map.containsKey(s.charAt(left))){\n                        map.put(s.charAt(left),map.get(s.charAt(left))+1);\n                        if(map.get(s.charAt(left)) > 0){\n                            count --;\n                        }\n                    }\n                    left ++ ;\n                }\n            }\n        }\n        if(minLen>s.length())  \n        {  \n            return "";  \n        }  \n        \n        return s.substring(minLeft,minLeft+minLen);\n    }\n}
[]