We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9240e87 commit 1368fc8Copy full SHA for 1368fc8
src/main/java/com/fishercoder/solutions/fourththousand/_3208.java
@@ -2,6 +2,10 @@
2
3
public class _3208 {
4
public static class Solution1 {
5
+ /**
6
+ * My completely original solution:
7
+ * we just keep looking for the possible k alternating groups, if it encounters the same color, then set i to that pointer and restart.
8
+ */
9
public int numberOfAlternatingGroups(int[] colors, int k) {
10
int len = colors.length;
11
int groups = 0;
0 commit comments