Spaces:
Sleeping
Sleeping
Download dataset/problem_4/buggy.py from Viraj0112/rl_code_fix_env: direct link, hf CLI and curl.
- Browser
- Download file 491 Bytes
-
https://huggingface.co/spaces/Viraj0112/rl_code_fix_env/resolve/main/dataset/problem_4/buggy.py
- Command line
-
hf download hf://spaces/Viraj0112/rl_code_fix_env/dataset/problem_4/buggy.py
-
curl -L -o buggy.py https://huggingface.co/spaces/Viraj0112/rl_code_fix_env/resolve/main/dataset/problem_4/buggy.py
491 Bytes
| def merge_sorted(left: list[int], right: list[int]) -> list[int]: | |
| """Merge two sorted lists into one sorted list.""" | |
| merged = [] | |
| i = 0 | |
| j = 0 | |
| # BUG: should continue while BOTH lists still have elements, | |
| # and then append remainders. | |
| while i < len(left) and j < len(right): | |
| if left[i] < right[j]: | |
| merged.append(left[i]) | |
| i += 1 | |
| else: | |
| merged.append(right[j]) | |
| j += 1 | |
| return merged | |