Skip to content

Commit 1368fc8

Browse files
add comments for 3208
1 parent 9240e87 commit 1368fc8

File tree

1 file changed

+4
-0
lines changed
  • src/main/java/com/fishercoder/solutions/fourththousand

1 file changed

+4
-0
lines changed

src/main/java/com/fishercoder/solutions/fourththousand/_3208.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
public class _3208 {
44
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+
*/
59
public int numberOfAlternatingGroups(int[] colors, int k) {
610
int len = colors.length;
711
int groups = 0;

0 commit comments

Comments
 (0)