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.
// Complete this function
Arrays.sort(calorie);
int l=calorie.length;
int j=0;
long miles=0;
for(int i=(l-1);i>=0;i--){
miles=miles+(long)(calorie[i]*Math.pow(2,j));
j++;
}
return miles;
}
Marc's Cakewalk
You are viewing a single comment's thread. Return to all comments →
My java Solution
static long marcsCakewalk(int[] calorie) {