You are viewing a single comment's thread. Return to all comments →
One-liner JavaScript
calorie.sort((p,c) => c - p).reduce((p,c,i) => p + c * Math.pow(2, i), 0)
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 →
One-liner JavaScript