Help for this page

Select Code to Download


  1. or download this
    my ($x, $y)
      = find_best_partition(map int(rand(1000)), 1..100);
    
  2. or download this
    sub find_best_partition {
      # We're going to try to find partitions that add up to each possible
    ...
    
      return (\@part_1, \@part_2);
    }
    
  3. or download this
    sub find_best_partition {
      my @numbers = sort {abs($b) <=> abs($a) or $a <=> $b} @_;
    ...
    
      return (\@part_1, \@part_2);
    }