Julia, 111 bytes
r\n='A':'Z'⊆uppercase(r) ? count(isletter,r)=>r : n+1=>""
~S=minimum(S[i:j]\n for i=1:(n=length(S)),j=1:n)[2]
- returns
""
for falsy cases - very ineffective (both time and memory)
- does not optimize for window size/length - only the letter length is considered
- -1 byte by changing
n+1
for2n
...