Golang solution
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

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

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

# Code
```golang []
func numberOfSubstrings(s string, k int) int {
	n := len(s)
	var res int
	var countMap = make(map[string]int)
	start, end := 0, 0
	for end < n {
		countMap[string(s[end])]++
		if CheckMap(countMap, k) {
			tempres := (n - end)
			res += tempres
			track := 0
			for CheckMap(countMap, k) {
				track++
				countMap[string(s[start])]--
				start++
			}
			if track-1 >= 0 {
				res = res + ((track - 1) * (tempres))
			}
		}
		end++
	}
	return res
}

func CheckMap(mp map[string]int, k int) bool {
	for _, val := range mp {
		if val >= k {
			return true
		}
	}
	return false
}
```
['Go']