Help for this page

Select Code to Download


  1. or download this
    use feature qw(say state);
    
    ...
    my @partitions = map { state $c = 0; [$c, $c += $_] } @widths;
    
    say '[', join(', ', @$_), ']' for @partitions;
    
  2. or download this
    [0, 2]
    [2, 8]
    [8, 13]
    [13, 20]
    
  3. or download this
    [2, 2]
    [8, 8]
    [13, 13]
    [20, 20]