Participate in Codex, Test Your Skills & Win BIG

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

Discussion


Loading...
Click here to start solving coding interview questions