private static int min(int [] nums) { int min = -1;
if (nums != null && nums.length != 0) {
min = nums [0]; for (int i = 1 ; i < nums.length ; i ++) { if (nums[i] < min) {
min = nums[i];
}
}
} return min;
}
private static int max(int [] nums) { int max = -1;
if (nums != null && nums.length != 0) {
max = nums [0]; for (int i = 1 ; i < nums.length ; i ++) { if (nums[i] > max) {
max = nums[i];
}
}
} return max;
}