Skip to content

Commit 6b24aa4

Browse files
committed
Correcting indentation
1 parent 557b7e0 commit 6b24aa4

File tree

1 file changed

+19
-20
lines changed

1 file changed

+19
-20
lines changed
Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,39 @@
11
class Solution:
2-
def findAnagrams(self, s: str, p: str) -> List[int]:
3-
sl = len(s)
4-
droite,taille = len(p),len(p)
5-
if(sl<droite):
2+
def findAnagrams(self, s: str, p: str) -> List[int]:
3+
sl = len(s)
4+
droite, taille = len(p), len(p)
5+
if (sl < droite):
66
return []
77
res = []
88
window = dict()
99
need = dict()
10-
for c in p:
10+
for c in p:
1111
need[c] = need.get(c, 0) + 1
1212
tmp = s[0]
1313
gauche = 0
14-
droite = gauche+taille
14+
droite = gauche + taille
1515
for c in s[:droite]:
16-
window[c] = window.get(c,0)+1
17-
if(window==need):
16+
window[c] = window.get(c, 0) + 1
17+
if (window == need):
1818
res.append(0)
19-
while(droite<sl):
19+
while (droite < sl):
2020
debut = s[gauche]
2121
value = window.get(debut)
22-
if(value<=1):
22+
if (value <= 1):
2323
del window[debut]
2424
else:
25-
window[debut]-=1
25+
window[debut] -= 1
2626
tmp = s[droite]
27-
#print("tmp = ",tmp)
28-
if(tmp not in need):
27+
if (tmp not in need):
2928
window.clear()
30-
gauche+=1
31-
droite = gauche+taille
29+
gauche += 1
30+
droite = gauche + taille
3231
for c in s[gauche:droite]:
33-
window[c]=window.get(c,0)+1
32+
window[c] = window.get(c, 0) + 1
3433
else:
35-
window[tmp] = window.get(tmp,0)+1
36-
gauche+=1
37-
droite = gauche+taille
38-
if(window==need):
34+
window[tmp] = window.get(tmp, 0) + 1
35+
gauche += 1
36+
droite = gauche + taille
37+
if (window == need):
3938
res.append(gauche)
4039
return res

0 commit comments

Comments
 (0)