Easy cpp solution || begineers approach
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 n = s.length();\n        int left=0,right=0,count=0;\n            int min_len=INT_MAX;\n            string result="";\n            \n            while(right<n)\n            {\n                    count=help(s[right],count,true);\n                    \n                    while(count==k)\n                    {\n                            tie(min_len,result)=help(s,left,right,min_len,result);\n                            count=help(s[left],count,false);\n                            left++;\n                    }\n                    right++;\n            }        \n            return result;\n                }\n        private:\n        int help(char c,int count,bool increment=true)\n        {\n            if(c==\'1\')\n                    return increment?count+1:count-1;\n            return count;    \n        }\n        \n        pair<int,string> help(string s,int left,int right,int min_len,string result)\n        {\n                int len=right-left+1;\n                if(len<min_len)\n                {\n                        min_len=len;\n                        result=s.substr(left,len);\n                }\n                else if(len==min_len)\n                {\n                        result=min(result,s.substr(left,len));\n                }\n                return make_pair(min_len,result);\n        }\n};\n```
['C++']