What wrong in my code

#include
using namespace std;
int main() {
string str,pat;
cin>>str>>pat;
int hash_str[256]={0};
int hash_pat[256]={0};
int m=str.length();
int n=pat.length();

for(int i=0;i<n;i++){
	hash_pat[pat[i]-'a']=hash_pat[pat[i]-'a']+1;
}

int start=0;
int len=0;
int min=1000;
int p=0;
int q=m-1;
int count=0;
for(int i=0;i<m;i++){

hash_str[str[i]-‘a’]=hash_str[str[i]-‘a’]+1;
if((hash_pat[str[i]-‘a’]!=0)&&(hash_pat[str[i]-‘a’]>=hash_str[str[i]-‘a’])){
count=count+1;

}

if(count==n){

while((hash_pat[str[start]-'a']<hash_str[str[start]]-'a')||(hash_pat[str[start]-'a']==0)){
    cout<<str[i];

if(hash_pat[str[start]-'a']<hash_str[str[start]-'a'])
{
    hash_str[str[i]-'a']=hash_str[str[i]-'a']-1;
    
}
	start=start+1;
}
if(min>(i-start+1)){
    min=i-start+1;
    p=start;
    q=i;
    
}

}

}
for(int i=p;i<=q;i++){
cout<<" "<<str[i];
}
return 0;
}

@dineshjani Please provide the code in coding Blocks IDE.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

@dineshjani
The doubt was reopened.
Is your doubt resolved?

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.