- or download this
# Reverse sort the set and partitions and insert sums
- or download this
@$rs = reverse sort numerically @$rs ;
@a = ($sa, reverse sort numerically @a) ;
@b = ($sb, reverse sort numerically @b) ;
- or download this
# Done -- return partitins in required order
- or download this
if ($a[0] >= $b[0]) { return (\@a, \@b) ; }
else { return (\@b, \@a) ; } ;
} ;
- or download this
# Sort the callers array in-place
@$set = sort{ $b<=>$a } @$set;
...
: ([ $sumB, sort{ $b<=>$a } @partB ], [ $sumA, sort{ $b<=>$a }
+ @partA ])
;
}