Greedy Algorithms - Minimum Cost to Connect Sticks
Consider the following Python code snippet that calculates the minimum cost to connect sticks:
```python
import heapq
def min_cost(sticks):
heapq.heapify(sticks)
total = 0
while len(sticks) > 1:
a = heapq.heappop(sticks)
b = heapq.heappop(sticks)
cost = a + b
total += cost
heapq.heappush(sticks, cost)
return total
```
What is the output of
min_cost([1, 8, 3, 5])?