Greedy Algorithms - Reorganize String (No Two Adjacent Same)
Consider this buggy code snippet for reorganizing a string. Which line contains the subtle bug that can cause the function to return an invalid string with adjacent duplicates?
```python
freq = Counter(s)
max_heap = [(-count, ch) for ch, count in freq.items()]
heapq.heapify(max_heap)
prev_count, prev_char = 0, ''
result = []
while max_heap:
count, ch = heapq.heappop(max_heap)
result.append(ch)
heapq.heappush(max_heap, (prev_count, prev_char)) # Line X
prev_count, prev_char = count + 1, ch
```
