We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent baf8937 commit 4305f28Copy full SHA for 4305f28
solution/3400-3499/3499.Maximize Active Section with Trade I/Solution.java
@@ -3,7 +3,7 @@ public int maxActiveSectionsAfterTrade(String s) {
3
int n = s.length();
4
int ans = 0, i = 0;
5
int pre = Integer.MIN_VALUE, mx = 0;
6
-
+
7
while (i < n) {
8
int j = i + 1;
9
while (j < n && s.charAt(j) == s.charAt(i)) {
@@ -18,7 +18,7 @@ public int maxActiveSectionsAfterTrade(String s) {
18
}
19
i = j;
20
21
22
ans += mx;
23
return ans;
24
0 commit comments