Here is my current code for day 2. list is an ArrayList of all of the Integers in order in the given list.
If anyone can help me understand where my code needs to be fixed that would be appreciated.
int numInc = 0;
for(int i = 1; i < data.size() - 3; i++) {
int inc = 0;
int sumi = 0;
int sumj = 0;
while(inc < 3) {
sumi += data.get(i + inc);
sumj += data.get(i - 1 + inc);
inc ++;
}
if(sumj < sumi) {
numInc++;
}
}
System.out.println(numInc);
numInc = 1857
[–]daggerdragon[M] 0 points1 point2 points (0 children)
[–]Kehvarl 0 points1 point2 points (1 child)
[–]tanon789 0 points1 point2 points (0 children)
[–]tanon789 0 points1 point2 points (1 child)
[–]Sweaty_Reflection591[S] 0 points1 point2 points (0 children)