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