Sunday, 15 May 2011

arraylist - Combinations of array elements -



arraylist - Combinations of array elements -

may similar question asked in past, not able find solution problem. have 2d array of integers {{1,2,3},{7,5},{4,9}}, want possible combinations array elements.

output should - {{1,7,4},{1,7,9},{1,5,4},{1,5,9},{2,7,4},{2,5,9},{3,7,4},{3,5,9}}

can help me in ?

in groovy (which assume want):

[[1,2,3],[7,5],[4,9]].combinations()

arrays arraylist groovy

No comments:

Post a Comment