Find the missing permutation: Difference between revisions

m
(two methods)
Line 795:
EndDataSection</lang>
 
Based on the [[http://rosettacode.org/wiki/Permutations#PureBasic Permutations]] task the solution could be:
'''Output'''
<lang PureBasic>If OpenConsole()
DBAC is missing.
NewList a.s()
findPermutations(a(), "ABCD", 4)
ForEach a()
Select a()
Case "ABCD","CABD","ACDB","DACB","BCDA","ACBD","ADCB","CDAB","DABC"
Case "BCAD","CADB","CDBA","CBAD","ABDC","ADBC","BDCA","DCBA","BACD"
Case "BADC","BDAC","CBDA","DBCA","DCAB"
Default
PrintN(A()+" is missing.")
EndSelect
Next
Print(#CRLF$ + "Press ENTER to exit"): Input()
EndIf</lang>
 
=={{header|Python}}==
Anonymous user