Back to task

158 symbols perl
Sun Oct 25 00:11:39 2015 vakorol
#!/usr/bin/perl -ln
$,='';sub f{my($a,$r)=@_;@$a-$_||print@$a;for$c(0..$_-1){my($i,$b);for(@$a){$b=1,last if$c==$_||abs$c-$_==$r-$i++}!$b&&f($A=[@$a,$c],$r+1)&&return$A}}f([])


Leave a comment

Parsed as Markdown

Login to leave a comment