Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
|
|
@ -0,0 +1,19 @@
|
|||
import strutils
|
||||
|
||||
proc missingPermutation(arr): string =
|
||||
result = ""
|
||||
if arr.len == 0: return
|
||||
if arr.len == 1: return arr[0][1] & arr[0][0]
|
||||
|
||||
for pos in 0 .. <arr[0].len:
|
||||
var s: set[char] = {}
|
||||
for permutation in arr:
|
||||
let c = permutation[pos]
|
||||
if c in s: s.excl c
|
||||
else: s.incl c
|
||||
for c in s: result.add c
|
||||
|
||||
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""".split()
|
||||
|
||||
echo missingPermutation(given)
|
||||
Loading…
Add table
Add a link
Reference in a new issue