Skip to content

Commit e40aba7

Browse files
committed
Runtime: 78 ms (Top 84.71%) | Memory: 42.5 MB (Top 77.27%)
1 parent e84696b commit e40aba7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
// Runtime: 78 ms (Top 84.71%) | Memory: 42.5 MB (Top 77.27%)
12
var maxPower = function(s) {
23
let count = 1;
34
let maxNum =1;
4-
5+
56
for(let i=0;i<s.length;i++){
67
(s[i]===s[Number(i)+1]) ? count++ : count=1;
78
maxNum = Math.max(count,maxNum);
89
}
9-
10-
return maxNum;
11-
};
10+
11+
return maxNum;
12+
};

0 commit comments

Comments
 (0)