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.
I want to recieve feedback to improve about my solution y Javascript:
functionminiMaxSum(arr){letaux=0,valMax=0,valMin=0;//solution to define valMin because inicialize it with 0 it's problematicarr.forEach((num)=>{valMin+=num;})for(leti=0;i<arr.length;i++){for(letj=0;j<arr.length;j++){if(i!=j){aux+=arr[j]}}if(aux<=valMin){valMin=aux;}if(aux>=valMax){valMax=aux;}aux=0;}console.log(`${valMin}${valMax}`)}
Mini-Max Sum
You are viewing a single comment's thread. Return to all comments →
I want to recieve feedback to improve about my solution y Javascript: