Find the missing permutation: Difference between revisions
Content deleted Content added
Updated to work with Nim 1.4: added missing parameter type, replaced ".. <" by "..<" and replaced "split" by "splitWhiteSpace". |
Updated to work with Nim 1.4: added missing parameter type, replaced ".. <" by "..<" and replaced "split" by "splitWhiteSpace". |
||
Line 2,052:
if arr.len == 1: return arr[0][1] & arr[0][0]
for pos in 0 ..
var s: set[char] = {}
for permutation in arr:
Line 2,061:
const given = """ABCD CABD ACDB DACB BCDA ACBD ADCB CDAB DABC BCAD CADB CDBA
CBAD ABDC ADBC BDCA DCBA BACD BADC BDAC CBDA DBCA DCAB""".
echo missingPermutation(given)</lang>
|