Datasets:
Download code/math_code_007_solution.py from efe-T/bilingual-math-code-verification-v1: direct link, hf CLI and curl.
- Browser
- Download file 444 Bytes
-
https://huggingface.co/datasets/efe-T/bilingual-math-code-verification-v1/resolve/main/code/math_code_007_solution.py
- Command line
-
hf download hf://datasets/efe-T/bilingual-math-code-verification-v1/code/math_code_007_solution.py
-
curl -L -o math_code_007_solution.py https://huggingface.co/datasets/efe-T/bilingual-math-code-verification-v1/resolve/main/code/math_code_007_solution.py
444 Bytes
| blocked = {(1, 1), (2, 3)} | |
| dp = [[0] * 5 for _ in range(5)] | |
| for x in range(5): | |
| for y in range(5): | |
| if (x, y) in blocked: | |
| continue | |
| if (x, y) == (0, 0): | |
| dp[x][y] = 1 | |
| else: | |
| dp[x][y] = (dp[x-1][y] if x else 0) + (dp[x][y-1] if y else 0) | |
| assert dp[1][1] == 0 and dp[2][3] == 0 | |
| result = {"valid_paths": dp[4][4]} | |
| import json | |
| print(json.dumps(result, ensure_ascii=False, sort_keys=True)) | |