in reply to Re^3: How to restrict partitions
in thread How to restrict partitions
Or, if all the values of the partitions must be unique, maybe something like (untested):
use Integer::Partition qw(); use List::MoreUtils qw(uniq); my $i = Integer::Partition->new(6); my $n = 5; while (my $p = $i->next()) { do_whatever_with($p) if (@$p == $n) and (@$p == uniq @$p); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: How to restrict partitions
by crunch_this! (Acolyte) on Jan 19, 2014 at 03:11 UTC |