Bhanuvenkat's blog

By Bhanuvenkat, history, 10 days 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

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

»
10 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by Bhanuvenkat (previous revision, new revision, compare).

»
10 days ago, # |
  Vote: I like it 0 Vote: I do not like it

Problem url?