Marc's Cakewalk

  • + 0 comments

    Here is my single line Python solution :

    def marcsCakewalk(calorie):
        # Write your code here    
        return sum((2**i) * calorie[i] for i in range(len(calorie))) if calorie.sort(reverse=True) or True else 0