At Perconaâ€™s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!
Become a Premium Member and unlock a new, free course in leading technologies each month.
public int centeredAverage(int[] nums) {
int large=0;
int small=0;
for(int n:nums){
large= Math.max(large, n);
//large=n;
}
for(int n:nums){
small= Math.min(large, n);
// small=n;
}
return (large-small);
}
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
public int centeredAverage(int[] nums) {
int large=Integer.MIN_VALUE;
int small=Integer.MAX_VALUE;
int sum=0;
for(int n:nums){
large = Math.max(large, n);
small = Math.min(small, n);
sum += n;
}
return (sum-large-small)/(nums.length-2);
}
public int centeredAverage(int[] nums) {
int large=Integer.MIN_VALUE;
int small=Integer.MAX_VALUE;
int sum=0;
for(int n:nums){
large = Math.max(large, n);
small = Math.min(small, n);
sum += n;
}
return (sum-large-small)/(nums.length-2);
}
public int centeredAverage(int[] nums) {
int large=0;
int small=0;
for(int n:nums){
large= Math.max(large, n);
//large=n;
}
for(int n:nums){
small= Math.min(large, n);
// small=n;
}
return (large-small);
}
Which is absolutely not similar.If you are experiencing a similar issue, please ask a related question
Join the community of 500,000 technology professionals and ask your questions.