<gh_stars>100-1000
__________________________________________________________________________________________________
class Solution:
    def connectSticks(self, s: List[int]) -> int:
        heapq.heapify(s)
        ret = 0
        while len(s) > 1:
            a, b = heapq.heappop(s), heapq.heappop(s)
            ret += a + b
            heapq.heappush(s, a + b)
        return ret
__________________________________________________________________________________________________

__________________________________________________________________________________________________

__________________________________________________________________________________________________
class Solution:
    def connectSticks(self, s: List[int]) -> int:
        heapq.heapify(s)
        ret = 0
        while len(s) > 1:
            a, b = heapq.heappop(s), heapq.heappop(s)
            ret += a + b
            heapq.heappush(s, a + b)
        return ret
__________________________________________________________________________________________________

__________________________________________________________________________________________________