We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
functionminiMaxSum(arr){// Write your code hereconstarrLen=arr.length-1;letfinalArr=[];for(letindex=0;index<=arrLen;index++){letnumber=0;for(letinner=0;inner<=arrLen;inner++){if(index!=inner){number+=arr[inner];}}finalArr.push(number);}console.log(Math.min(...finalArr),Math.max(...finalArr));}
Cookie support is required to access HackerRank
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 →