My use case was Advent of Code 2015 where I have a list of cities to create a
route through and I wanted my list of cities to be a hashset (to avoid
duplicates) and then permutate all the possible options to calculate distance.
>From your response, I understand by definition the hashset can't be
I want to pass a hashset to std/algorithm's nextPermutation and can't because
nextPermutation accepts an OpenArray (an array or sequence), but not a hashset.
Are my options then:
* copy my hashset into a sequence for use with other std/procs that require
OpenArray's, or,
* don't use hashset
I find nre to be more reliable, as the following code block suggests.
import re,nre
let
re1 = re.re"dd"
re2 = nre.re"dd"
echo re.match("ugknbfddgicrmopn",re1)
echo nre.contains("ugknbfddgicrmopn",re2)
false
true
Run
Of course, could be I