Whats the time complexity of this?

must

#1

for(int i = 0, j = 0, sum = 0; i < N; i++) {
for(; j < N && sum < target; j++) sum += A[j];
if(sum == target) output(i, j);
sum -= A[i];
}


#2

n²logn+a
a is the constant