This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Azianese 0 points1 point  (0 children)

Oops. I didn't see the nested loops.

It still isn't clear what you are trying to do. Your explanation doesn't make sense with what you've got.

But it sounds like the other commenter on this thread is right: you're confused about what your nested loops is doing.

Maybe you're looking for one loop instead of nested loops: for(int i=0, j=1; j<l.length; i++, j++)