Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 2
    I don't understand why you are iterating over the same elements so many times. There are only 2*800 = 1,600 elements, but you are iterating 640,000 times. You are therefore visiting each element many times. Commented Jul 14, 2018 at 10:34
  • you need a 2nd loop...because you need to loop through the columns Commented Jul 14, 2018 at 10:58
  • @MatthewWatson That's a good question. My end goal is to iterate through all possible combinations of values. It is not enough to just get the necessary element from within an array. It's as you said - there are only 1600 elements total, but these 1600 elements can create 640000 unique combinations. Commented Jul 14, 2018 at 12:34
  • Ah, so what you want is every combination of one element from each column. Commented Jul 14, 2018 at 12:56