You are viewing a single comment's thread. Return to all comments →
C++ Solution
long marcsCakewalk(vector<int> calorie) { sort(calorie.begin(), calorie.end(), greater<int>()); int exponent = 0; long result = 0; for(int i : calorie) result = result + (i * pow(2, exponent++)); return result; }
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