Skip to content

Commit ccc75c5

Browse files
committed
Runtime: 81 ms (Top 17.97%) | Memory: 13.9 MB (Top 73.17%)
1 parent 7e4be92 commit ccc75c5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

scripts/algorithms/P/Positions of Large Groups/Positions of Large Groups.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
# Runtime: 81 ms (Top 17.97%) | Memory: 13.9 MB (Top 73.17%)
12
class Solution:
23
def largeGroupPositions(self, s: str) -> List[List[int]]:
3-
4+
45
i=0
56
c=1
67
prev=""
@@ -13,9 +14,8 @@ def largeGroupPositions(self, s: str) -> List[List[int]]:
1314
ans.append([i+1-c,i])
1415
else:
1516
if c>=3:
16-
ans.append([i-c,i-1])
17-
c=1
17+
ans.append([i-c,i-1])
18+
c=1
1819
prev=s[i]
1920
i+=1
2021
return ans
21-

0 commit comments

Comments
 (0)