sliding window
Intuition\nSliding Window with one additional check.\n\n# Approach\n Keep expanding until we have enough 1\'s. \n Once we have enough update the res accordingly
# Intuition\nSliding Window with one additional check.\n\n# Approach\n* Keep expanding until we have enough 1\'s. \n* Once we have enough update the res accordingly and Keep shrinking the window.\n* One extra thing to do here is if we already have min length substring, then we compare the Lexicographic order.\n\n# Complexity\n- Time complexity: O(N)\n\n- Space complexity: O(1)\n\n# Code\n```python3 []\nclass Solution:\n    def shortestBeautifulSubstring(self, s: str, k: int) -> str:\n        i,res,cnt=0,"",{"0":0, "1":0}\n        for j,n in enumerate(s): \n            cnt[n]+=1\n            while cnt["1"]>=k: \n                if res=="" or j-i+1<len(res): \n                    res=s[i:j+1]\n                elif len(res)==j-i+1 and res>s[i:j+1]: res=s[i:j+1]\n                cnt[s[i]]-=1\n                i+=1\n        return res\n```
['Python3']