I have been asked the following question in an interview and I am still thinking of an efficient way of doing it.

You have an array whose numbers represent percentages of liquids in a barrel.You also have an API with a method: `combine(int x,int y)` which takes two input percentages in the array and combines the liquid from one barrel to another. By using this information you have to find maximum number of barrels that can be possible with 100% liquid.

**Example 1.** Array: 10,15,20,35,55,65

**Ans**:Number of barrels would be 2.
Since `combine(65,35)`---one 100% barrel,
`combine(55,20)`--75% barrel, next `combine(75,15)`--90% next `combine(90,10)`--100%--1 barrel
So total 2 barrels

**Example 2: 99,99,99**

**Ans:** Number of barrels would be 1 here since you do `combine(99,99)`--you get one 100% barrel the rest of the liquid is wasted and you can't combine any other barrel with the third 99% barrel to make it 100

Note:once you pour liquid from one barrel to another you can't use it again 
for ex: `combine(55,15)`--70% barrel. You can use 70% barrel but not 55% and 15% barrels.