Find the missing permutation: Difference between revisions
m
Use correct markup for subheaders. Alternates getting counted as entries.
m (→Haskell :: Character frequency in each column: Reduced one pair of brackets) |
Thundergnat (talk | contribs) m (Use correct markup for subheaders. Alternates getting counted as entries.) |
||
Line 1,687:
{{works with|Julia|0.6}}
=== Obvious method ===
Calculate all possible permutations and return the first not included in the array.
<lang julia>using BenchmarkTools, Combinatorics
Line 1,706:
<pre>missingperm(arr) = "DBAC"</pre>
=== Alternative method 1 ===
{{trans|Python}}
<lang julia>function missingperm1(arr::Vector{<:AbstractString})
Line 1,722:
</lang>
=== Alternative method 2 ===
{{trans|Raku}}
<lang julia>function missingperm2(arr::Vector)
|