Help for this page

Select Code to Download


  1. or download this
    my @arr = (0,0,1, 3,2,0, 1,1,1);
    my @output;
    ...
    
    say @output.perl;
    # output: [1, 5, 3]
    
  2. or download this
    my @arr = (0,0,1, 3,2,0, 1,1,1);
    my @output = gather {
    ...
            take $a + $b + $c;
        }
    }