HackerRank- Mini-Max Sum (easy)

Link to code challenge
function miniMaxSum(arr) { let newArr = arr.sort((a, b) => a - b); let lowest = newArr.slice(0, newArr.length - 1).reduce((a, b) => a + b); let highest = newArr.slice(1).reduce((a,b) => a + b); console.log(lowest, highest); }

Comments

Popular posts from this blog

Code Wars: Data Reverse (6 kyu)

Code Wars: longest_palindrome (6 kyu)

Code Wars: Find the odd int