Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    find( \@diag, $n, $k, $threshold, 0, [], \@result );
    
    print "@$_: ".sum(map{$MTX->[$_][$_]}@$_)."\n" for @result;
    
  2. or download this
    push @$result, [ @$solution, $array->[$_][1] ] for grep { $array->[$_][0] > $threshold } $start..$n-1;