Marc's Cakewalk

  • + 0 comments

    Here is my Python solution :

    def marcsCakewalk(calorie):
        # Write your code here    
        calorie.sort(reverse = True)
        dist = 0
        exponent = 1
        for i in range(len(calorie)):
            dist += exponent * calorie[i]
            exponent *= 2
        
        return dist