Find the missing permutation: Difference between revisions
Content deleted Content added
→{{header|Lua}}: typo fix |
→{{header|Lua}}: shortened |
||
Line 1,108:
=={{header|Lua}}==
Using the popular Penlight extension module - https://luarocks.org/modules/steved/penlight
<lang Lua>local permute, tablex = require("pl.permute"), require("pl.tablex")
local permList, pStr = {
"ABCD", "CABD", "ACDB", "DACB", "BCDA", "ACBD", "ADCB", "CDAB",
Line 1,122 ⟶ 1,114:
"DCBA", "BACD", "BADC", "BDAC", "CBDA", "DBCA", "DCAB"
}
for
pStr = table.concat(perm)
if
end</lang>
{{out}}
|