Bhanuvenkat's blog

By Bhanuvenkat, history, 4 weeks ago, In English

I apply two pointers technique as

int j=0;

for(int i=0;i<n;i++){

add(a[i]);

 while(!func(sum)){

        j++;

       sub(a[j]);

     }

ans+= max(something) // or any thing needed in quesiton

}

I want to apply this on cyclic array can anyone modify the code so that it can be applied on cyclic array

Full text and comments »

  • Vote: I like it
  • -3
  • Vote: I do not like it