Comments

is today's contest becomes unrated..?

On hgthecoderPLAGIARISM, 3 years ago
0

did you get penalty for this plagiarism..?

you are not moving j.

while(i>=0){ if(isCoPrime(arr[j],arr[i])){ found=true; ans=i+j+2; break; } i--; }

In this loop you are not decreasing j.this approach is wrong according to me if you try with two loop then it will show TLE. see Editorial.

check for: 1 2 3 6 according to your code ans should be 4 but real ans is 6 because 2 and 3 are coPrime so, 2*3 = 6.

In problem D (Coprime) , would anyone help me to understand that how its time comlexity becomes O(a2i (logai+n))