|
Download math/math-0153.jsonl from winapiadmin/tinycodinglm: direct link, hf CLI and curl.
- Browser
- Download file 861 Bytes
-
https://huggingface.co/datasets/winapiadmin/tinycodinglm/resolve/034ba678829a1c436b19d43dd3adab33b5170a80/math/math-0153.jsonl
- Command line
-
hf download hf://datasets/winapiadmin/tinycodinglm@034ba678829a1c436b19d43dd3adab33b5170a80/math/math-0153.jsonl
-
curl -L -o math-0153.jsonl https://huggingface.co/datasets/winapiadmin/tinycodinglm/resolve/034ba678829a1c436b19d43dd3adab33b5170a80/math/math-0153.jsonl
861 Bytes
| {"type": "session", "harness": "opencode", "id": "math-0153", "name": "Catalan Number Implementations"} | |
| {"type": "message", "message": {"role": "system", "content": "You are an expert mathematician and programmer."}} | |
| {"type": "message", "message": {"role": "user", "content": "Show Catalan number code"}} | |
| {"type": "message", "message": {"role": "assistant", "content": "DP: catalan[0]=1; for i=1..n: for j=0..i: catalan[i] += catalan[j]*catalan[i-1-j];\n\nDirect mod prime: C = binomial(2*n,n); C = C * mod_inverse(n+1) % MOD;\n\nParentheses gen: gen(open,close,s): if open==0 and close==0 print s; if open>0 gen(open-1,close,s+'('); if close>open gen(open,close-1,s+')');\n\nBST from sorted array: pick root, recurse left/right. Count = Catalan.\nDyck paths: dp[i][j] = paths reaching height j at step i. dp[0][0]=1. dp[i][j]=dp[i-1][j-1]+dp[i-1][j+1]."}} | |