Spaces:
Sleeping
Sleeping
Download dataset/problem_17/buggy.py from Viraj0112/rl_code_fix_env: direct link, hf CLI and curl.
- Browser
- Download file 401 Bytes
-
https://huggingface.co/spaces/Viraj0112/rl_code_fix_env/resolve/main/dataset/problem_17/buggy.py
- Command line
-
hf download hf://spaces/Viraj0112/rl_code_fix_env/dataset/problem_17/buggy.py
-
curl -L -o buggy.py https://huggingface.co/spaces/Viraj0112/rl_code_fix_env/resolve/main/dataset/problem_17/buggy.py
401 Bytes
| def dedupe_preserve_order(items: list[int]) -> list[int]: | |
| """Remove duplicates while preserving first occurrence order.""" | |
| seen = set() | |
| out = [] | |
| for item in items: | |
| # BUG: keeps last occurrence logic effectively by replacing list. | |
| if item in seen: | |
| out = [x for x in out if x != item] | |
| seen.add(item) | |
| out.append(item) | |
| return out | |