Some test cases are not passing

#include
#include
#include
#include
using namespace std;

void string_window(string s, string t){
int n=s.length();
int m=t.length();
int l=0,r;

map<char,int> ms,mt;

int resl=-1;
long long int resr=1000000000;

for(int i=0;i<m;i++){
	mt[t[i]]++;
}

for (r=0;r<n;r++){
	bool good=true;
	ms[s[r]]++;

	for (auto x:mt){
		if (ms.count(x.first)==0 || ms[x.first]<x.second){
			good=false;
			break;
		}
	}

	if (!good)
	continue;

	while (l<n && l<=r && (mt.count(s[l])==0 || ms[s[l]]>mt[s[l]]) ){
		ms[s[l]]--;
		if (ms[s[l]]==0)
		ms.erase(s[l]);
		l++;
	}

	if(resr-resl+1 > r-l+1){
		resl=l;
		resr=r;
	}
}
if (resl==-1){
	cout<<"No String";
}
else{
string ans=s.substr(l,resr-resl+1);
cout<<ans;
}

}

int main() {
string s,t;
getline(cin,s);
getline(cin,t);
string_window(s,t);
return 0;
}