in reply to Anagrams & Letter Banks
"Given a list whose elements are strings (containing only letters, as they are actually English-language words), how would one print that list only on the condition that at least one of the strings in the list contains no repeated letters?"
#!/usr/bin/perl # http://perlmonks.org/?node_id=1202179 use strict; use warnings; my $good = [qw( allo mallo malo)]; my $bad = [qw( tillo sillo sallo)]; grep !/(.).*\1/, @$_ and print "@$_\n" for $good, $bad;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Anagrams & Letter Banks
by dominick_t (Acolyte) on Oct 27, 2017 at 20:31 UTC | |
by Cristoforo (Curate) on Oct 27, 2017 at 20:41 UTC | |
by dominick_t (Acolyte) on Oct 27, 2017 at 20:45 UTC | |
by dominick_t (Acolyte) on Oct 27, 2017 at 20:52 UTC | |
by Laurent_R (Canon) on Oct 27, 2017 at 21:50 UTC | |
|