On the Internet to see the 2018 Forensic Science Reasoning Test, found that this is a good Python lianbi program, so the violence solved a bit.
Answer: Bcacacdaba
55 lines of code version:
defCheck (L):#Q2t=[2,3,0,1] ifL[5]!=t[l[2]]: returnFalse; #Q3T=[l[3],l[6],l[2],l[4]] x=t[l[3]] T.pop (l[3]) ifXinchT:returnFalse; #Q4t=[(L[1],l[5]), (L[2],l[7]), (L[1],l[9]), (l[6],l[10])] ifT[l[4]][0]!=t[l[4]][1]: returnFalse; #Q5T=[l[8],l[4],l[9],l[7]] ifL[5]!=t[l[5]]: returnFalse; #Q6t=[(L[2],l[4]), (L[1],l[6]), (l[3],l[10]), (l[5],l[9])] ifT[L[6]][0]!=T[L[6]][1]orT[l[6]][0]!=l[8]: returnFalse; #Q7t=[2,1,0,3] TT=[l.count (0), L.count (1), L.count (2), L.count (3)] ifTt.index (min (TT))!=t[l[7]]: returnFalse; #Q8T=[l[7],l[5],l[2],l[10]] ifABS (T[l[8]]-l[1])%3<=1: returnFalse; #Q9T=[l[6],l[10],l[2],l[9]] if(l[1]==l[6]) = = (t[l[9]]==l[5]): returnFalse; #Q10t=[3,2,4,1] ifMax (L.count (0), L.count (1), L.count (2), L.count (3))-min (L.count (0), L.count (1), L.count (2), L.count (3))!=t[l[10]]: returnFalsereturnTrue forS1inchRange (4): forS2inchRange (4): forS3inchRange (4): forS4inchRange (4): forS5inchRange (4): forS6inchRange (4): forS7inchRange (4): forS8inchRange (4): forS9inchRange (4): forS10inchRange (4): L=[-1, S1,s2,s3,s4,s5,s6,s7,s8,s9,s10]ifCheck (L):Print("'. Join (Chr (I+ord ('A')) forIinchL[1:]))
Improved 38-Line code version:
ImportItertoolsdefCheck (L): t=[2,3,0,1]#Q2 ifL[5]!=t[l[2]]: returnFalse; T=[L[3],L[6],L[2],L[4]]#Q3X=t[l[3]] T.pop (l[3]) ifXinchT:returnFalse; T=[(L[1],l[5]), (L[2],l[7]), (L[1],l[9]), (l[6],l[10])#Q4 ifT[l[4]][0]!=t[l[4]][1]: returnFalse; T=[L[8],L[4],L[9],L[7]]#Q5 ifL[5]!=t[l[5]]: returnFalse; T=[(L[2],l[4]), (L[1],l[6]), (l[3],l[10]), (l[5],l[9])#Q6 ifT[L[6]][0]!=T[L[6]][1]orT[l[6]][0]!=l[8]: returnFalse; T=[2,1,0,3] TT=[l.count (0), L.count (1), L.count (2), L.count (3)]#Q7 ifTt.index (min (TT))!=t[l[7]]: returnFalse; T=[L[7],L[5],L[2],L[10]]#Q8 ifABS (T[l[8]]-l[1])%3<=1: returnFalse; T=[L[6],L[10],L[2],L[9]]#Q9 if(l[1]==l[6]) = = (t[l[9]]==l[5]): returnFalse; T=[3,2,4,1]#Q10 ifMax (L.count (0), L.count (1), L.count (2), L.count (3))-min (L.count (0), L.count (1), L.count (2), L.count (3))!=t[l[10]]: returnFalsereturnTruea=[[x forXinchRange (4)] forIinchRange (10)] forLinchItertools.product (*a): L= (-1,) +LifCheck (L):Print("'. Join (Chr (I+ord ('A')) forIinchL[1:]))
2018 the Python violence resolution of the Forensic examination Section 38 lines of code