Find the missing permutation: Difference between revisions

m
(octave added)
Line 903:
'DCBA';'BACD';'BADC';'BDAC'; ...
'CBDA';'DBCA';'DCAB' ];
val = 4.^(3:-1:0)';
 
there = 1+(toascii(given)-toascii('A'))*4.^(0:3)'val;
every = 1+perms(0:3)*4.^(0:3)'val;
 
bits = zeros(max(every),1);
bits(every) = 1;
bits(there) = 0;
missing = dec2base(find(bits)-1,'ABCD')</lang>
</lang>
 
=={{header|Oz}}==
Anonymous user