I\'m studying for a test and found this question:
I can\'t really determine the complexity, I figured it\'s either O(n2) or O(n3) and I\'m lea
You can model the running time of the function as
sum(sum(sum(Theta(1), k=i+1..j),j=i..n),i=1..n)
As
sum(sum(sum(1, k=i+1..j),j=i..n),i=1..n) = 1/6 n^3 - 1/6 n,
the running time is Theta(n^3).