BlazingCustoms/pybytecode-mbpp-3.12
Data card — MBPP held-out decompilation benchmark 383 MBPP reference solutions compiled to Python 3.12 bytecode and paired with their source, with the original task_id restored on every row. Built 2026-08-04 by tools/build_mbpp_ood.py. Redistributable under CC-BY-4.0, provided NOTICES.md ships alongside. The set Rows 383 (400 candidates − 17 contaminated) Source google-research-datasets/mbpp, config full Licence CC-BY-4.0 task_id restored 383 /… See the full description on the dataset page: https://huggingface.co/datasets/BlazingCustoms/pybytecode-mbpp-3.12.
0479
1import heapq2from collections import Counter3 4def rearange_string(S):5 ctr = Counter(S)6 heap = [(-value, key) for key, value in ctr.items()]7 heapq.heapify(heap)8 if -heap[0][0] * 2 > len(S) + 1:9 return ''10 ans = []11 while len(heap) >= 2:12 nct1, char1 = heapq.heappop(heap)13 nct2, char2 = heapq.heappop(heap)14 ans.extend([char1, char2])15 if nct1 + 1:16 heapq.heappush(heap, (nct1 + 1, char1))17 if nct2 + 1:18 heapq.heappush(heap, (nct2 + 1, char2))19 return ''.join(ans) + (heap[0][1] if heap else '')