Help for this page

Select Code to Download


  1. or download this
    sub p09{
    @_?reduce{$a->[-1][0]eq$b?push@{$a->[-1]},$b:push@{$a},[$b];$a;}[[shif
    +t]],@_:()
    }
    
  2. or download this
    use List::Util qw[ reduce ];
    sub p09 { 
    ...
        } [[shift]], @_ 
        :()
    }