It seems as if it is a matter of the length of the array. Ignoring the possibility of two of the same number in the array, this should work:



public int combinations(int length){
if(length...