in reply to Find duplicate digits
my @keep; # numbers to keep while(chomp( my $line = <NUMBERS> ) ) { my @digits = split '', $line; my %count; ++$count{$_} for @digits; if( grep { $_ == 2 } values %count ) { push @keep, $line; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Find duplicate digits
by radiantmatrix (Parson) on Feb 15, 2006 at 15:54 UTC | |
by friedo (Prior) on Feb 15, 2006 at 16:25 UTC | |
by radiantmatrix (Parson) on Feb 15, 2006 at 18:46 UTC | |
by GrandFather (Saint) on Feb 16, 2006 at 03:51 UTC | |
|
Re^2: Find duplicate digits
by Not_a_Number (Prior) on Feb 15, 2006 at 21:14 UTC | |
|
Re^2: Find duplicate digits
by Anonymous Monk on Feb 15, 2006 at 15:15 UTC |