NESTED_CMPL2

What is the time complexity of the following code :

    int a = 0;
    for (i = 0; i < N; i++) {
        for (j = N; j > i; j--) {
            a = a + i + j;
        }
    }
Hints
  • Solution Approach
  • Complete Solution
32120 successful submissions.
Click here to jump start your coding interview preparation