Marc's Cakewalk

  • + 0 comments

    Python 3

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