Print all combinations of r elements in a given array.