Go Distinct
func distinct(a []int) int {
	seen := make(map[int]struct{}, len(a))
	for _, v := range a {
		seen[v] = struct{}{}
	}

	return len(seen)
}

This counts unique values by tracking what has already been seen.