You are viewing a single comment's thread. Return to all comments →
C++ solution :
long marcsCakewalk(vector<int> calorie) { long sum=0; sort(calorie.begin(), calorie.end(), greater<int>()); for (int i=0;i<calorie.size();i++) sum+=pow(2, i)*calorie[i]; return sum; }
Seems like cookies are disabled on this browser, please enable them to open this website
Marc's Cakewalk
You are viewing a single comment's thread. Return to all comments →
C++ solution :