http://www.perlmonks.org?node_id=533626


in reply to Re: Finding Neighbours of a String
in thread Finding Neighbours of a String

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.