Datasets:
Download code/math_code_007_verify.py from efe-T/bilingual-math-code-verification-v1: direct link, hf CLI and curl.
- Browser
- Download file 555 Bytes
-
https://huggingface.co/datasets/efe-T/bilingual-math-code-verification-v1/resolve/main/code/math_code_007_verify.py
- Command line
-
hf download hf://datasets/efe-T/bilingual-math-code-verification-v1/code/math_code_007_verify.py
-
curl -L -o math_code_007_verify.py https://huggingface.co/datasets/efe-T/bilingual-math-code-verification-v1/resolve/main/code/math_code_007_verify.py
555 Bytes
| from itertools import combinations | |
| blocked = {(1, 1), (2, 3)} | |
| count = 0 | |
| for right_positions in combinations(range(8), 4): | |
| right_positions = set(right_positions) | |
| x = y = 0 | |
| valid = True | |
| for step in range(8): | |
| if step in right_positions: | |
| x += 1 | |
| else: | |
| y += 1 | |
| if (x, y) in blocked: | |
| valid = False | |
| break | |
| if valid: | |
| assert (x, y) == (4, 4) | |
| count += 1 | |
| result = {"valid_paths": count} | |
| import json | |
| print(json.dumps(result, ensure_ascii=False, sort_keys=True)) | |