Given an positive integer array with distinct elements, find all possible subset pairs having equal average. How to do this ?
Example: arr={5,10,6,7} Ans: {7},{5,6,10}
Exp: average of first subset=7 average of second subset=(5+6+7)/3=21/3=7
(two subsets for the array which when combined must have all the elements non repeated in the array). Problem is to find all possible pairs and print them. How to do this?
PS: I am not posting my homework stuff and i am learning algorithms. I couldnt find any approach to solve this.