Help for this page

Select Code to Download


  1. or download this
    Without //= patch:
    @x=@_;my%c;$e=sub{my$v=pop;exists$c{$v}?$c{$v}:$c{$v}=$v<0?0:$v==0||gr
    +ep&$e($v-$_),@x};$t=$s=0;{&$e(++$t)?$t-$s>=$x[0]&&last:($s=$t);redo}$
    +s
    
    With //= patch:
    @x=@_;my%c;$e=sub{my$v=pop;$c{$v}//=$v<0?0:$v==0||grep&$e($v-$_),@x};$
    +t=$s=0;{&$e(++$t)?$t-$s>=$x[0]&&last:($s=$t);redo}$s
    
  2. or download this
    @x=@_;my%c;$e=sub{my$v=pop;$c{$v}//=$v==0||$v>0&&grep&$e($v-$_),@x};$t
    +=$s=0;{&$e(++$t)?$t-$s>=$x[0]&&last:($s=$t);redo}$s
    
  3. or download this
    @x=@_;my%c;$e=sub{my$v=pop;$c{$v}//=!$v||$v>0&&grep&$e($v-$_),@x};for(
    +$t=$s=0;$t-$s<$x[0];&$e(++$t)or$s=$t){}$s