Simple Go sliding window solution
Complexity
Time complexity: O(n)

Space complexity: O(1)
Code
# Complexity
- Time complexity: O(n)
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity: O(1)
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```golang []
func shortestBeautifulSubstring(s string, k int) string {
	var ans string
	var l, freq int

	for r := range s {
		if s[r] == '1' {
			freq++
		}
		for freq == k {
			str := s[l : r+1]
			if ans == "" || (len(str) < len(ans)) || (len(str) == len(ans) && str < ans) {
				ans = str
			}

			if s[l] == '1' {
				freq--
			}
			l++
		}
	}

	return ans
}
```
['Sliding Window', 'Go']