Help for this page

Select Code to Download


  1. or download this
    my @list = (
         a => [ 'b', 'c', 'e' ],
    ...
         f => [ 'a' ],
    );
    print join (',', map { "'$_'" } f2(@list)),"\n";
    
  2. or download this
    sub f {
    %r=@_;map{$m{$_}={map{$m{$_}||={};$_=>1}@{$r{$_}}}}keys%r;
    reverse sort{my$t=$m{$b}{$a}-$m{$a}{$b};warn"$a,$b:$t";$t}keys%m;
    }
    
  3. or download this
    f,e:0 at ...
    a,f:0 at ...
    b,a:1 at ...
    c,b:1 at ...
    d,c:1 at ...