You are viewing a single comment's thread. Return to all comments →
Easy Java Sol:
public static long marcsCakewalk(List<Integer> calorie) { Collections.sort(calorie, Collections.reverseOrder()); int n = calorie.size(); long miniMiles = 0; for(int i=0; i<n ;i++){ double expo = Math.pow(2,i) * calorie.get(i); miniMiles = miniMiles + (long)expo; } return miniMiles; }
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 →
Easy Java Sol: