You are viewing a single comment's thread. Return to all comments →
The solution in javascript is:
let aux = arr.map(item => +item).sort() let min = [...aux].slice(0,-1) let max = [...aux].slice(1) console.log(min.reduce((acc, i) => acc+i,0)+ ' ' + max.reduce((acc, i) => acc+i,0))
Seems like cookies are disabled on this browser, please enable them to open this website
Mini-Max Sum
You are viewing a single comment's thread. Return to all comments →
The solution in javascript is: