You are viewing a single comment's thread. Return to all comments →
Perl:
sub cutTheSticks { my $arr = shift; my @res; my $n = scalar(@$arr); while ($n > 0) { push(@res, scalar(@$arr)) if scalar(@$arr) > 0; my $min = min(@$arr); @$arr = map {$_ - $min} @$arr; @$arr = grep {!/^0$/} @$arr; $n--; } return @res; }
Seems like cookies are disabled on this browser, please enable them to open this website
Cut the sticks
You are viewing a single comment's thread. Return to all comments →
Perl: