SalooP's blog

By SalooP, history, 7 years ago, In English

Look at these submissions:

26586468

26586481

They have one different that is using:

for(int c:vec)

instead of:

for(int j=0;j<vec.size();j++){
    int c = vec[j];
    ...
}

one get Runtime and other one is Accepted.

I think that is happen because I change the size of my vector in the "for" However the size of it will be constant after each step.

Can I anyone explain? Tnks a lot.

Full text and comments »

  • Vote: I like it
  • +15
  • Vote: I do not like it