R=solve1() P1=set([s for s in R if not bit(s,7)]) reach=[] for s in range(128): ok=True if bit(s,3) and not bit(s,0): ok=False if bit(s,4) and not bit(s,1): ok=False if (bit(s,5) or bit(s,6)) and not bit(s,2): ok=False if ok: reach.append(s) print('reach',len(reach),'P1',len(P1)) print('missing',sorted(set(reach)-P1)) print('extra',sorted(P1-set(reach)))