GoalScope — counting_sort (Qwen2.5-Coder-32B-Instruct) — hover a token to see the patched verbalization
↵
<code>↵
def counting_sort(arr):↵
"""Counting sort algorithm implementation."""↵
if not arr:↵
return arr↵
↵
max_val = max(arr)↵
count = [0] * (max_val + 1)↵
↵
for num in arr:↵
count[num] += 1↵
↵
sorted_arr = []↵
for num, freq in enumerate(count):↵
sorted_arr.extend([num] * freq)↵
↵
return sorted_arr↵
</code>