Arithmetic sequence in array
Using raw types (generic types without type parameter) is a major violation:


List list = new ArrayList();



Never ever do this. In any case, as @JS1 already pointed out in comments,
this list in your implementation is unused anyway. (another major violation)

Declare variables in the smallest scope possible.
For example,
you could declare front inside the for statement,
and total inside the body:

for (int back = 0, front = 0; back &lt; A.length &amp;&amp; front &lt; A.length; ) {
    front = back + 2;
    int total = A[front - 1] - A[back];


You could also convert the inner while loop to a for loop,
and declare the variable i inside the statement.