Big O Unsure (single problem) int a = 0;
    for (int i = 0; i &lt; n*n; ++i) {
        for (int j = 0; j &lt;= i; ++j) {
            a += j;
        }
    }


Could someone help prove to me that this is function is $O(N^4)$. 

I remember doing this problem a while back, but now I do not see it.

I understand that the outer loop is $O(N^2)$ but I am unsure of how this would cause the inner loop to be $O(N^2)$ as well
Consider the range of j in the inner loop:


What is its maximum?
What is its average?
What is its average average?