Function to minimize the maximum difference between any pair of elements of the array by the given operations
static int minimumMaxDiff ( int [ ] nums ) { TreeSet < Integer > s = new TreeSet < Integer > ( ) ;