Your approach generates oodles of duplicates which it then filters back out by eating up memory for hashes. The approach I outlined above generates no dupes to begin with.
I didn’t know about Math::Combinatorics though; nice module. It did annoy me that I had to use two different modules with confusing differences in their APIs. I’ll update my code to use M::C instead. Nope, doesn’t help, still need S::CP.
Makeshifts last the longest.
In reply to Re^2: Finding Neighbours of a String
by Aristotle
in thread Finding Neighbours of a String
by monkfan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |