If you didn't understand why this could be helpful


#1

In every step, the program increases i by one. The program terminates when i reaches n . The “outer loop” is run n times.

There is also an “inner loop” about j . But all it does is increase j until it reaches i (at most, sometimes it does less). j is never decreased. So that part is also run at most n times in total (not n times for each iteration of the “outer loop”).