• + 0 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))