C++ || Simple || Clean Code
Code\n\nclass Solution {\npublic:\n    string shortestBeautifulSubstring(string s, int k) {\n        string res = "";\n        int left = 0, right = 0, count = 
# Code\n```\nclass Solution {\npublic:\n    string shortestBeautifulSubstring(string s, int k) {\n        string res = "";\n        int left = 0, right = 0, count = 0;\n        while (left <= right && right < s.size()) {\n            count += s[right++] == \'1\' ? 1 : 0;\n            while (left < right && count >= k) {\n                if (count == k) {\n                    if (res.size() == 0) res = s.substr(left, right - left);\n                    else if (res.size() > right - left) res = s.substr(left, right - left);\n                    else if (res.size() == right - left) res = res > s.substr(left, right - left) ? s.substr(left, right - left) : res;\n                }\n                count -= s[left++] == \'1\' ? 1 : 0;\n            }\n        }\n        return res;\n    }\n};\n```
['C++']