1class Solution {2 public int numTimesAllBlue(int[] flips) {3 int counter = 0, total = 0, max = Integer.MIN_VALUE;4 for (int i = 0; i < flips.length; i++) {5 if (max < flips[i]) max = flips[i];6 if (++counter == max) total++;7 }8 return total;9 }10}
WPM •0 •0
ACC •0 •0
TIME •0