We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aae01c6 commit ff1f8bbCopy full SHA for ff1f8bb
1 file changed
src/counter/Cribbage.java
@@ -94,16 +94,15 @@ private static List<Integer> getLongestConsecutive(ArrayList<Integer> scores) {
94
for (int i = 0; i < listWithoutDuplicates.size() - 1; i++) {
95
if (listWithoutDuplicates.get(i) + 1 == listWithoutDuplicates.get(i + 1)) {
96
run++;
97
- array.add(listWithoutDuplicates.get(i + 1));
98
} else {
99
if (maxRun < run) {
100
maxRun = run;
101
maxArray = array;
102
}
103
run = 1;
104
array = new ArrayList<>();
105
- array.add(listWithoutDuplicates.get(i));
106
+ array.add(listWithoutDuplicates.get(i + 1));
107
108
if (maxRun < run)
109
0 commit comments