File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ using namespace std;
9
9
string smallestWindow (string s,string p){
10
10
unordered_map<char ,int > freqp;
11
11
for (char c:p){
12
- freqp[c]++; # taking in every character of the partial string
12
+ freqp[c]++; // taking in every character of the partial string
13
13
}
14
14
int distinct=freqp.size ();
15
15
unordered_map<char ,int > freqw;
@@ -20,9 +20,9 @@ string smallestWindow(string s,string p){
20
20
21
21
while (r<s.length ()){
22
22
while (r<s.length () && count<distinct){
23
- freqw[s[r]]++; # taking in the main string
23
+ freqw[s[r]]++; // taking in the main string
24
24
if (freqp.find (s[r])!=freqp.end () && freqw[s[r]]==freqp[s[r]]){
25
- count++; # if the char matches than count increased
25
+ count++; // if the char matches than count increased
26
26
}
27
27
r++; #increment uptil the main string length
28
28
}
@@ -31,7 +31,7 @@ string smallestWindow(string s,string p){
31
31
ans=r-l;
32
32
li=l;
33
33
ri=r;
34
- flag=true ; # setting the flag true if window found
34
+ flag=true ; // setting the flag true if window found
35
35
}
36
36
freqw[s[l]]--;
37
37
if (freqp.find (s[l])!=freqp.end ()&& freqw[s[l]]<freqp[s[l]]){
You can’t perform that action at this time.
0 commit comments