function miniMaxSum(arr) {
// Write your code here
const sortedArray = arr.sort();
let min_sum = 0
let max_sum = 0
for(let i =0; i < arr.length; i++){
if( i < arr.length -1 ) {
min_sum += arr[i]
}
if (i > 0) {
max_sum += arr[i]
}
}
console.log(min_sum , max_sum)
}
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (5)
this.guy().is().doing().functional-programming()
This is great, i also solved this using PHP ( Mini-Max Sum Solution using PHP) incase someone needs that.
Nice to meet you great job