Problem :

https://www.hackerrank.com/challenges/marcs-cakewalk/problem


My Solution :

#!/usr/bin/env python3

def marcsCakewalk(n, calorie):
    calorie = sorted(calorie, reverse=True)
    return sum([calorie[i]*(2**i) for i in range(n)])


n = int(input())
calorie = list(map(int, input().strip().split()))
result = marcsCakewalk(n, calorie)
print(result)
secret