Julia, 111,110,108 10896 bytes
!S=minimum((r=S[i:j];'A':'Z'⊆uppercase(r) ? count(isletter,r)=>r : 2n=>"")
for i=1:(n=length(S)),j=1:n)[2]
!S=minimum(['A':'Z'⊆(r=S[i:j])|>uppercase ? sum(isletter,r) : Inf,r]
for i=(k=keys(S)),j=k)[2]
Attempt This Online!
- returns
""
for falsy cases - very ineffectivecredits to @MarcMush: (both time and memory)96 bytes
- does not optimize for window size/lengthmy first attack: - only the letter length is considered108 bytes
It returns ""
for falsy cases; very ineffective (both for time and for memory); it does not optimize for window size/length - only the letter length is considered