Iterate over array twice (cartesian product) but consider only half the elements

前端 未结 3 1346
感动是毒
感动是毒 2021-01-14 05:18

I am trying to iterate over an array twice to have pairs of elements (e_i,e_j) but I only want the elements such that i < j.

Basically, what I want would look lik

3条回答
提交回复
热议问题