usr bin perl ARGV max ind -1 foreach max or max and ind print ind

1
2
3
4
5
6
7
8
#!/usr/bin/perl
$a=$ARGV[0];
$max=$ind=-1;
foreach (0..9) {
@c = "$a" =~ /($_)/g;
@c < $max or ($max=@c and $ind=$_);
}
print "$ind\n";