I have problems to give the right time complexity in O notation for the following loop:k := 0for i := 0 to N   for j := k to M     // something   k = k + 1Where 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?
Time complexity of a nested loop where the inner value is decreased in every step
computer science;theory