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


in reply to Re: Re: Re: Re: TIMTOWTDI and other languages
in thread TIMTOWTDI and other languages

The example would work in Perl 6.

It would also scale a little better than nested loops since =~ on an array will short-circuit on finding any match in the array.

Of course, Perl 6 may also have superpositions natively, in which case the problem might be solvable in constant time (on the right hardware ;-)