This question evaluates proficiency in string processing, handling character-uniqueness constraints, and algorithmic thinking about time and space efficiency.

You are given a string s and an integer n.
Find the shortest contiguous substring of s that contains exactly n distinct characters.
If there is no such substring, return an empty string (or -1, depending on how you choose to represent "not found"). If multiple substrings have the same minimal length, returning any one of them is acceptable.
s
: a non-empty string composed of ASCII letters (you may assume lowercase English letters if you want to simplify).
n
: an integer,
1 <= n <= 26
(assuming lowercase letters) and
n <= number of distinct characters in s
if a valid answer exists.
s
that contains exactly
n
distinct characters, or an indication that no such substring exists.
s = "aabcbc"
,
n = 2
"aa"
,
"ab"
,
"bc"
,
"cb"
, etc.
"aa"
,
"ab"
,
"bc"
,
"cb"
is acceptable.
s = "abac"
,
n = 3
"aba"
(a, b),
"abac"
(a, b, c),
"bac"
(b, a, c)
"bac"
of length 3.
s = "aaaa"
,
n = 2
-1
.
n = 0
,
n = 1
,
n > distinct characters in s
, and very long strings.