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.
functionmarcsCakewalk(calorie){// Write your code herevarresult=0calorie.sort((a,b)=>(a>b?-1:1))for(vari=0;i<calorie.length;i++){result+=Math.pow(2,i)*calorie[i]}returnresult}
Marc's Cakewalk
You are viewing a single comment's thread. Return to all comments →
This is my solution in JavaScript