Shortest Java accepted code


#1
public int canCompleteCircuit(final List<Integer> A, final List<Integer> B) {
    // TODO: check A==null || B==null || A.size()!=B.size()
    int tank=0, pos = 0;
    for(int i=0; i < A.size(); ++i) {
        tank += A.get(i) -  B.get(i);
        if (tank < 0) {
            pos = i+1;
        }
    }
    return (tank < 0) ? -1 : pos;
}

#2

Wrong answer for this solution