C++ sliding window
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    string shortestBeautifulSubstring(string s, int k) {\n        int i=0,j=0,count=0;\n        int minl=INT_MAX;\n        string ans="";\n        while(j<s.length())\n        {\n            if(s[j]==\'1\')count++;\n            \n            if(count==k)\n            {\n                \n                while(count==k)\n                {\n                    string t=s.substr(i,j-i+1);\n                    if(t.length()<minl)\n                    {\n                        minl=t.length();\n                        ans=t;\n                    }\n                    else if(t.length()==ans.length())ans=min(ans,t);\n                        \n                    if(s[i]==\'1\')\n                    {\n                        count--;\n                    }\n                    i++;\n                }              \n            }\n            j++;\n        }\n        return ans;\n    }\n};\n```
['Sliding Window', 'C++']