- or download this
sub P {
# This is so that we don't go off the deep end with recursion : )
...
map({ [$_[0], @$_] } P($_[1]))
}
}
- or download this
5
4 1
...
2 1 1 1
1 1 1 1 1
And many duplicates (which i handle seperately)
- or download this
sub u{map{[split//,$_]}sort{$b cmp$a}keys%{{map{my$t=join'',@$_;$t=>1}
+@_}}}