If you Like the Video then Plzz consider Subscribing .☺CODE:class Solution{ public: string smallestWindow (string s, string p){ if(p.length()>s.length()){ return "-1"; } unordered_map mp; int p_hash[26] = {0}; for(int i=0;i 0){ count++; } } i++; } j++; } if(startindex == -1) return "-1"; else return s.substr(startindex,minlength); }};
If you Like the Video then Plzz consider Subscribing .☺
CODE:
class Solution{
public:
string smallestWindow (string s, string p){
if(p.length()>s.length()){
return "-1";
}
unordered_map mp;
int p_hash[26] = {0};
for(int i=0;i 0){
count++;
}
}
i++;
}
j++;
}
if(startindex == -1)
return "-1";
else
return s.substr(startindex,minlength);
}
};