Jump to content

Find the missing permutation: Difference between revisions

m
J: do not take up so much screen space
m (J: do not take up so much screen space)
Line 235:
<lang j>missingPerms =: -.~ (A.~ i.@!@#) @ {.</lang>
Use:
<pre>data=:>;: 'ABCD CABD ACDB DACB BCDA ACBD ADCB CDAB DABC BCAD CADB CDBA'
<pre>deficientPermsList=: ] ;. _2, 0 : 0
data=:data,>;: 'CBAD ABDC ADBC BDCA DCBA BACD BADC BDAC CBDA DBCA DCAB'
ABCD
missingPerms deficientPermsListdata
CABD
ACDB
DACB
BCDA
ACBD
ADCB
CDAB
DABC
BCAD
CADB
CDBA
CBAD
ABDC
ADBC
BDCA
DCBA
BACD
BADC
BDAC
CBDA
DBCA
DCAB
)
missingPerms deficientPermsList
DBAC</pre>
 
6,962

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.