Find the missing permutation: Difference between revisions
Frink
(→{{header|Vlang}}: Rename "Vlang" in "V (Vlang)") |
(Frink) |
||
Line 1,263:
End</syntaxhighlight>
<pre>Output is the same as the first version</pre>
=={{header|Frink}}==
<syntaxhighlight lang="frink">p = toSet[trim[splitLines["""ABCD
CABD
ACDB
DACB
BCDA
ACBD
ADCB
CDAB
DABC
BCAD
CADB
CDBA
CBAD
ABDC
ADBC
BDCA
DCBA
BACD
BADC
BDAC
CBDA
DBCA
DCAB"""]]]
s = ["A","B","C","D"]
for n = s.lexicographicPermute[]
{
str = join["", n]
if ! p.contains[str]
println[str]
}</syntaxhighlight>
{{out}}
<pre>
DBAC
</pre>
=={{header|GAP}}==
|