Java program to equally divide n elements into two sets such that second set has maximum distinct elements .
import java . util . * ; class GFG { static int distribution ( int arr [ ] , int n ) { Set < Integer > resources = new HashSet < Integer > ( ) ;