Minimum And Maximum Difference Problem