Freigeben über


Bad Perl: Josephus problem

This blog post has moved to https://matthewvaneerde.wordpress.com/2009/07/29/bad-perl-josephus-problem/

Comments

  • Anonymous
    July 29, 2009
    76 I believe (wc -m says so perl -e '@A=1..$ARGV[0];while($A[1]){$j=shift@A;push(@A,$j)if(++$i)%$ARGV[1]}print@A' 12 3 Pat