Open loveapplejy opened 5 years ago
https://www.hackerrank.com/challenges/mini-max-sum/problem
function miniMaxSum(arr) { arr.sort((a, b) => a - b);
const minNum = arr.shift(); const maxNum = arr.pop(); const sum = arr.reduce((a, b) => a + b); console.log(`${sum + minNum} ${sum + maxNum}`);
}
https://www.hackerrank.com/challenges/mini-max-sum/problem