Skip to content
This repository was archived by the owner on Sep 22, 2021. It is now read-only.

Commit 84d0d26

Browse files
authored
Merge pull request #677 from Vinit-Dantkale/master
Adding solution to 1446_consecutive_characters
2 parents 6539451 + 905c4ac commit 84d0d26

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class Solution:
2+
def maxPower(self, s: str) -> int:
3+
maxlen,currlen=1,1
4+
for i in range(1,len(s)):
5+
if(s[i]==s[i-1]):
6+
currlen=currlen+1
7+
maxlen=max(maxlen,currlen)
8+
else:
9+
currlen=1
10+
return maxlen

0 commit comments

Comments
 (0)