I have problems to give the right time complexity in O notation for the following loop:
k := 0
for i := 0 to N
for j := k to M
// something
k = k + 1
Where N = M. Without the modified starting value of j of the inner value this would be of course O(N * M), but with the decreasing running time of the inner loop in every step of the outer loop I am quite confused. How can this be approached?
