java - Printing a 2D Array Combinations Without Duplicates -


i'm struggling print unique combinations 2d array hold same value.

example 2d array

[4, 4, 4, 4]

[4, 4, 4, 4]

possible unique combinations

0,1

0,2

0,3

1,2

1,3

could give pointers on how tackle this?

you can avoid looping through array correctly:

for (int = 0; < array.length; i++) {     (int j = i+1; j < array.length[i]; j++) {         // start j = i+1 avoid comparing same cells     } } 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -