InterviewBit Academy is now Scaler!
Learn Tech Skills from Scratch @ Scaler EDGE

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