Brute Force ✅
\n\n<<UpVote\n\n\nclass Solution {\npublic:\n    string shortestBeautifulSubstring(string s, int k) {\n        vector<string> ans;\n        for(int i=0;i<s.size
\n\n**<<UpVote**\n\n```\nclass Solution {\npublic:\n    string shortestBeautifulSubstring(string s, int k) {\n        vector<string> ans;\n        for(int i=0;i<s.size();i++){\n            string str;\n            for(int j=i;j<s.size();j++){\n                str+=s[j];\n                ans.push_back(str);\n            }\n        }\n        string res="";\n        for(auto a:ans){\n            int cnt=0;\n            for(int i=0;i<a.size();i++) if(a[i]==\'1\') cnt++;\n            if(cnt==k) if(res==""||res.size()>a.size() || (res.size()==a.size() && res>a)) res=a;\n        }\n        return res;\n    }\n};\n```
[]